diff options
author | Loïc Hoguin <[email protected]> | 2018-10-31 15:35:49 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-10-31 15:35:49 +0100 |
commit | 30e117a9420b21a94d185a27f174d0991e38077d (patch) | |
tree | 0057400ef2ea979fb113f48c097c6c12d9051dae /src | |
parent | 5ab5615ff0bc13e449cc3ff7ef528ffdeb1feb1f (diff) | |
download | cowboy-30e117a9420b21a94d185a27f174d0991e38077d.tar.gz cowboy-30e117a9420b21a94d185a27f174d0991e38077d.tar.bz2 cowboy-30e117a9420b21a94d185a27f174d0991e38077d.zip |
Make sure we don't send error_responses on the wrong stream
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_http.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index fff4e5b..340ced7 100644 --- a/src/cowboy_http.erl +++ b/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 |