A platform for community discussion. Free, open, simple.
FIX: uploads not working on themes admin page
Sam1fac2ecb5698
diff --git a/lib/hijack.rb b/lib/hijack.rbindex 7e942c58ee1..9814ea4bef1 100644--- a/lib/hijack.rb+++ b/lib/hijack.rb@@ -17,13 +17,19 @@ module Hijack# in the past unicorn would recycle env, this is not longer the caseenv = request.env++ # rack may clean up tempfiles unless we trick it and take control+ tempfiles = env[Rack::RACK_TEMPFILES]+ env[Rack::RACK_TEMPFILES] = nilrequest_copy = ActionDispatch::Request.new(env)transfer_timings = MethodProfiler.transferio = hijack.call- original_headers = response.headers+ # duplicate headers so other middleware does not mess with it+ # on the way down the stack+ original_headers = response.headers.dupScheduler::Defer.later("hijack #{params["controller"]} #{params["action"]}") do@@ -42,10 +48,7 @@ module Hijackinstance.request = request_copyoriginal_headers&.each do |k, v|- # hash special handling so skip- if k != "Cache-Control"- instance.response.headers[k] = v- end+ instance.response.headers[k] = vendbegin@@ -100,6 +103,8 @@ module Hijackstatus = response.status rescue 500request_tracker.log_request_info(env, [status, headers || {}, []], timings)end++ tempfiles&.each(&:close!)endend# not leaked out, we use 418 ... I am a teapot to denote that we are hijacked