summaryrefslogtreecommitdiff
path: root/src/mod_http_api.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-09-12 15:38:27 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-09-12 15:40:38 +0200
commit96d05dad8f84d81661685d38e1d06745842c789f (patch)
treecc5f02d3ebfc5bef7ac9db19eb993522560bdd92 /src/mod_http_api.erl
parentFix nick-to-jid mapping for MUC subscribers (diff)
Properly process OPTIONS header in http_api for all paths
Diffstat (limited to 'src/mod_http_api.erl')
-rw-r--r--src/mod_http_api.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl
index 73e6f7e4..95a4ad51 100644
--- a/src/mod_http_api.erl
+++ b/src/mod_http_api.erl
@@ -259,8 +259,10 @@ process([Call], #request{method = 'GET', q = Data, ip = IP} = Req) ->
?DEBUG("Bad Request: ~p ~p", [_Error, erlang:get_stacktrace()]),
badrequest_response()
end;
-process([], #request{method = 'OPTIONS', data = <<>>}) ->
+process([_Call], #request{method = 'OPTIONS', data = <<>>}) ->
{200, ?OPTIONS_HEADER, []};
+process(_, #request{method = 'OPTIONS'}) ->
+ {400, ?OPTIONS_HEADER, []};
process(_Path, Request) ->
?DEBUG("Bad Request: no handler ~p", [Request]),
json_error(400, 40, <<"Missing command name.">>).