Rails 5.1.4
Webrick includes Content-Length
in the response header. Changing to Puma 3.10.0
causes the Content-Length
to no longer appear. Is there a Puma setting to include the Content-Length
property in the response header?
Asked
Active
Viewed 538 times
0

hooinator
- 339
- 2
- 13
-
did you read https://stackoverflow.com/questions/29112728/when-does-rails-respond-with-transfer-encoding-vs-content-length ā Fabrizio Bertoglio Nov 19 '17 at 11:02
-
I did see that post. Iām not not sure if Webrick always sends the Content-Length and Rails has to explicitly set Content-Length when using Puma. Right now I am not setting Content-Length yet Webrick correctly sets it. ā hooinator Nov 19 '17 at 20:40
1 Answers
1
Use Rack::ContentLength middleware as suggested here: https://github.com/rails/rails/issues/32585
Add this to your development.rb / production.rb
config.middleware.use(Rack::ContentLength)

user3726408
- 11
- 2