mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01: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:
parent
326db5535c
commit
6601f182c4
@ -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]),
|
||||||
|
Loading…
Reference in New Issue
Block a user