diff options
author | Loïc Hoguin <[email protected]> | 2014-06-30 17:49:36 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-06-30 17:49:36 +0200 |
commit | 4eee5737004df8cf63071c410eb4f060cb2dbaa2 (patch) | |
tree | 102e9e2d9905359e8aa5306b90b90fb2446f422f /src/cowboy_rest.erl | |
parent | 8cc353114eea7113878463a934baf068ee255cb5 (diff) | |
download | cowboy-4eee5737004df8cf63071c410eb4f060cb2dbaa2.tar.gz cowboy-4eee5737004df8cf63071c410eb4f060cb2dbaa2.tar.bz2 cowboy-4eee5737004df8cf63071c410eb4f060cb2dbaa2.zip |
Return 422 instead of 400 when AcceptResource returns false
422 is undefined for HTTP and interpreted as 400.
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r-- | src/cowboy_rest.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index f76468a..fd1588a 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -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( |