Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't use #eof? when parsing multipart #1201
On chunked requests (
This change refactors the multipart parser so that it doesn't call
On chunked requests (`Transfer-Encoding: chunked`) content length won't be present, so `#eof?` will be called on the Rack input directly. However, the Rack input doesn't have to respond to `#eof?`, it's not part of the Rack specification. For example, `Rack::Lint::InputWrapper` and `Unicorn::StreamInput` don't respond to `#eof?`. This means that in development and on Unicorn, multipart parsing will fail for chunked request. This change refactors the multipart parser so that it doesn't call `#eof?`.
We are experiencing an issue with uploading documents that is very difficult to reproduce but randomly fails because rack is calling
@tenderlove would you consider tagging a new release for this? Technically, currently the latest rack release (2.0.6) does not conform to its own specifications because of this.
This update has two important fixes: 1. It reverts the monkey patch introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23385 since rack/rack#1201 is now part of the release. 2. Preserve forwarded IP address for trusted proxy chains (rack/rack#1343).