mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Make the return value of AcceptResource callback consistent
This commit is contained in:
parent
28186a68d0
commit
934393a168
2 changed files with 2 additions and 2 deletions
|
@ -842,7 +842,7 @@ process_content_type(Req, State=#state{method=Method,
|
|||
{false, Req2, HandlerState2} ->
|
||||
State2 = State#state{handler_state=HandlerState2},
|
||||
respond(Req2, State2, 422);
|
||||
{ResURL, Req2, HandlerState2} when Method =:= <<"POST">> ->
|
||||
{{true, ResURL}, Req2, HandlerState2} when Method =:= <<"POST">> ->
|
||||
State2 = State#state{handler_state=HandlerState2},
|
||||
Req3 = cowboy_req:set_resp_header(
|
||||
<<"location">>, ResURL, Req2),
|
||||
|
|
|
@ -28,4 +28,4 @@ to_text(Req, State) ->
|
|||
|
||||
from_text(Req, State) ->
|
||||
{Path, Req2} = cowboy_req:path(Req),
|
||||
{Path, Req2, State}.
|
||||
{{true, Path}, Req2, State}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue