24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-14 22:00:16 +02:00

mod_http_upload: Add "Allow" to OPTIONS response

RFC 2616 says: "A 200 response SHOULD include any header fields that
indicate optional features implemented by the server and applicable to
that resource (e.g., Allow) [...]."
This commit is contained in:
Holger Weiss 2018-07-17 19:42:57 +02:00
parent 326db5535c
commit 6601f182c4

View File

@ -464,7 +464,8 @@ process(_LocalPath, #request{method = 'OPTIONS', host = Host,
{Proc, _Slot} = parse_http_request(Request), {Proc, _Slot} = parse_http_request(Request),
case catch gen_server:call(Proc, get_conf, ?CALL_TIMEOUT) of case catch gen_server:call(Proc, get_conf, ?CALL_TIMEOUT) of
{ok, _DocRoot, CustomHeaders} -> {ok, _DocRoot, CustomHeaders} ->
http_response(200, CustomHeaders); AllowHeader = {<<"Allow">>, <<"OPTIONS, HEAD, GET, PUT">>},
http_response(200, [AllowHeader | CustomHeaders]);
Error -> Error ->
?ERROR_MSG("Cannot handle OPTIONS request from ~s for ~s: ~p", ?ERROR_MSG("Cannot handle OPTIONS request from ~s for ~s: ~p",
[?ADDR_TO_STR(IP), Host, Error]), [?ADDR_TO_STR(IP), Host, Error]),