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

Return 422 instead of 400 when AcceptResource returns false

422 is undefined for HTTP and interpreted as 400.
This commit is contained in:
Loïc Hoguin 2014-06-30 17:49:36 +02:00
parent 8cc353114e
commit 4eee573700
4 changed files with 7 additions and 7 deletions

View file

@ -780,7 +780,7 @@ process_content_type(Req, State=#state{method=Method, exists=Exists}, Fun) ->
next(Req2, State2, fun maybe_created/2);
{false, Req2, HandlerState2} ->
State2 = State#state{handler_state=HandlerState2},
respond(Req2, State2, 422);
respond(Req2, State2, 400);
{{true, ResURL}, Req2, HandlerState2} when Method =:= <<"POST">> ->
State2 = State#state{handler_state=HandlerState2},
Req3 = cowboy_req:set_resp_header(