0

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?

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 Answers1

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)