mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Don't calculate Content-Length, let Rack do that for us; fixes #4440
This commit is contained in:
parent
4f630adb21
commit
675e40c326
2 changed files with 8 additions and 5 deletions
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
[Sidekiq Changes](https://github.com/mperham/sidekiq/blob/master/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md)
|
[Sidekiq Changes](https://github.com/mperham/sidekiq/blob/master/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md)
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
---------
|
||||||
|
|
||||||
|
- Fix broken Web UI response when using NewRelic and Rack 2.1.2+. [#4440]
|
||||||
|
|
||||||
6.0.4
|
6.0.4
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|
|
@ -300,22 +300,20 @@ module Sidekiq
|
||||||
|
|
||||||
resp = case resp
|
resp = case resp
|
||||||
when Array
|
when Array
|
||||||
|
# redirects go here
|
||||||
resp
|
resp
|
||||||
else
|
else
|
||||||
|
# rendered content goes here
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type" => "text/html",
|
"Content-Type" => "text/html",
|
||||||
"Cache-Control" => "no-cache",
|
"Cache-Control" => "no-cache",
|
||||||
"Content-Language" => action.locale,
|
"Content-Language" => action.locale,
|
||||||
"Content-Security-Policy" => CSP_HEADER,
|
"Content-Security-Policy" => CSP_HEADER,
|
||||||
}
|
}
|
||||||
|
# we'll let Rack calculate Content-Length for us.
|
||||||
[200, headers, [resp]]
|
[200, headers, [resp]]
|
||||||
end
|
end
|
||||||
|
|
||||||
resp[1] = resp[1].dup
|
|
||||||
|
|
||||||
resp[1][CONTENT_LENGTH] = resp[2].sum(&:bytesize).to_s
|
|
||||||
|
|
||||||
resp
|
resp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue