Browse Source

Make the return value of AcceptResource callback consistent

Loïc Hoguin 12 years ago
parent
commit
934393a168
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/cowboy_rest.erl
  2. 1 1
      test/http_SUITE_data/rest_forbidden_resource.erl

+ 1 - 1
src/cowboy_rest.erl

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

+ 1 - 1
test/http_SUITE_data/rest_forbidden_resource.erl

@@ -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}.