0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00

cowboy_rest: Always set the Allow header

Not just on 405 responses or OPTIONS requests.
This commit is contained in:
Loïc Hoguin 2025-02-10 18:41:11 +01:00
parent 58402b4162
commit f316a65906
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 11 additions and 30 deletions

View file

@ -817,6 +817,7 @@ provide_callback(Config) ->
]),
{response, nofin, 200, Headers} = gun:await(ConnPid, Ref),
{_, <<"text/plain">>} = lists:keyfind(<<"content-type">>, 1, Headers),
{_, <<"HEAD, GET, OPTIONS">>} = lists:keyfind(<<"allow">>, 1, Headers),
{ok, <<"This is REST!">>} = gun:await_body(ConnPid, Ref),
ok.