mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
REST: Only send 201 when a new resource is created on POST
This commit is contained in:
parent
f51493ee37
commit
f6cf731011
1 changed files with 1 additions and 1 deletions
|
@ -699,7 +699,7 @@ process_post(Req, State) ->
|
|||
terminate(Req2, State#state{handler_state=HandlerState});
|
||||
{true, Req2, HandlerState} ->
|
||||
State2 = State#state{handler_state=HandlerState},
|
||||
next(Req2, State2, 201);
|
||||
next(Req2, State2, fun is_new_resource/2);
|
||||
{false, Req2, HandlerState} ->
|
||||
State2 = State#state{handler_state=HandlerState},
|
||||
respond(Req2, State2, 500)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue