Skip to content

Commit

Permalink
REST: Only send 201 when a new resource is created on POST
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Hoguin committed Feb 20, 2012
1 parent f51493e commit f6cf731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cowboy_http_rest.erl
Expand Up @@ -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)
Expand Down

0 comments on commit f6cf731

Please sign in to comment.