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

Make sure we don't send error_responses on the wrong stream

Loïc Hoguin 6 лет назад
Родитель
Сommit
30e117a942
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/cowboy_http.erl

+ 2 - 1
src/cowboy_http.erl

@@ -899,7 +899,8 @@ commands(State, StreamID, [{flow, _Length}|Tail]) ->
 
 	commands(State, StreamID, Tail);
 %% Error responses are sent only if a response wasn't sent already.
-commands(State=#state{out_state=wait}, StreamID, [{error_response, Status, Headers0, Body}|Tail]) ->
+commands(State=#state{out_state=wait, out_streamid=StreamID}, StreamID,
+		[{error_response, Status, Headers0, Body}|Tail]) ->
 	%% We close the connection when the error response is 408, as it
 	%% indicates a timeout and the RFC recommends that we stop here. (RFC7231 6.5.7)
 	Headers = case Status of