From 30e3c6abe542c6a9f5955e1d65896a0c3bab534f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 16 Dec 2017 01:22:40 +0000 Subject: avoid reusing env on hijack Hijackers may capture and reuse `env' indefinitely, so we must not use it in those cases for future requests. For non-hijack requests, we continue to reuse the `env' object to reduce memory recycling. Reported-and-tested-by: Sam Saffron --- lib/unicorn/http_request.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/unicorn/http_request.rb') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index f83a566..d713b19 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -98,6 +98,7 @@ class Unicorn::HttpParser # for rack.hijack, we respond to this method so no extra allocation # of a proc object def call + hijacked! env['rack.hijack_io'] = env['unicorn.socket'] end -- cgit v1.2.3-24-ge0c7