From 6601f182c4046a81ce52928a73a3fc5af5c6f8e8 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 17 Jul 2018 19:42:57 +0200 Subject: [PATCH] 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) [...]." --- src/mod_http_upload.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl index 0b790a907..6db8bd256 100644 --- a/src/mod_http_upload.erl +++ b/src/mod_http_upload.erl @@ -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]),