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
1 changed files with 2 additions and 1 deletions

View File

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