Просмотр исходного кода

Merge branch 'patch-1' of https://github.com/CamShaft/cowboy

Conflicts:
	src/cowboy_rest.erl
Loïc Hoguin 12 лет назад
Родитель
Сommit
d9b3727a62
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/cowboy_rest.erl
  2. 1 1
      test/http_SUITE.erl

+ 1 - 1
src/cowboy_rest.erl

@@ -793,7 +793,7 @@ choose_content_type(Req,
 			next(Req2, State2, OnTrue);
 		{false, Req2, HandlerState2} ->
 			State2 = State#state{handler_state=HandlerState2},
-			respond(Req2, State2, 500)
+			respond(Req2, State2, 422)
 	end;
 choose_content_type(Req, State, OnTrue, ContentType, [_Any|Tail]) ->
 	choose_content_type(Req, State, OnTrue, ContentType, Tail).

+ 1 - 1
test/http_SUITE.erl

@@ -855,7 +855,7 @@ rest_nodelete(Config) ->
 rest_patch(Config) ->
 	Tests = [
 		{204, [{<<"content-type">>, <<"text/plain">>}], <<"whatever">>},
-		{500, [{<<"content-type">>, <<"text/plain">>}], <<"false">>},
+		{422, [{<<"content-type">>, <<"text/plain">>}], <<"false">>},
 		{400, [{<<"content-type">>, <<"text/plain">>}], <<"halt">>},
 		{415, [{<<"content-type">>, <<"application/json">>}], <<"bad_content_type">>}
 	],