Properly process OPTIONS header in http_api for all paths
This commit is contained in:
parent
1aca541639
commit
96d05dad8f
|
@ -259,8 +259,10 @@ process([Call], #request{method = 'GET', q = Data, ip = IP} = Req) ->
|
||||||
?DEBUG("Bad Request: ~p ~p", [_Error, erlang:get_stacktrace()]),
|
?DEBUG("Bad Request: ~p ~p", [_Error, erlang:get_stacktrace()]),
|
||||||
badrequest_response()
|
badrequest_response()
|
||||||
end;
|
end;
|
||||||
process([], #request{method = 'OPTIONS', data = <<>>}) ->
|
process([_Call], #request{method = 'OPTIONS', data = <<>>}) ->
|
||||||
{200, ?OPTIONS_HEADER, []};
|
{200, ?OPTIONS_HEADER, []};
|
||||||
|
process(_, #request{method = 'OPTIONS'}) ->
|
||||||
|
{400, ?OPTIONS_HEADER, []};
|
||||||
process(_Path, Request) ->
|
process(_Path, Request) ->
|
||||||
?DEBUG("Bad Request: no handler ~p", [Request]),
|
?DEBUG("Bad Request: no handler ~p", [Request]),
|
||||||
json_error(400, 40, <<"Missing command name.">>).
|
json_error(400, 40, <<"Missing command name.">>).
|
||||||
|
|
Loading…
Reference in New Issue