0
Fork 0
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:
Loïc Hoguin 2012-02-20 08:33:54 +01:00
parent f51493ee37
commit f6cf731011

View file

@ -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)