0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Fix {cowboy_req, resp_sent} potentially leaking in loop handlers

This commit is contained in:
Loïc Hoguin 2013-01-29 14:35:26 +01:00
parent 8050f2e0fa
commit 638638a841
2 changed files with 18 additions and 4 deletions

View file

@ -121,6 +121,7 @@ handler_init(State=#state{env=Env, transport=Transport,
upgrade_error(Req, Env)
end.
%% Only send an error reply if there is no resp_sent message.
-spec upgrade_error(Req, Env) -> {ok, Req, Env} | {error, 400, Req}
when Req::cowboy_req:req(), Env::cowboy_middleware:env().
upgrade_error(Req, Env) ->