Don't use #eof? when parsing multipart#1201
Merged
rafaelfranca merged 1 commit intorack:masterfrom Jun 11, 2018
Merged
Conversation
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?`.
Member
|
This is a good idea and should be merged! |
|
@janko-m We just ran into private method errors where |
matthewd
pushed a commit
to matthewd/rack
that referenced
this pull request
Dec 19, 2018
…-for-chunked-requests Don't use #eof? when parsing multipart
|
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. |
|
I also was just bit by this bug. Any timeline of pushing a 2.0.7 rack version that includes this fix? |
tigefa4u
pushed a commit
to tigefa4u/gitlabhq
that referenced
this pull request
Apr 5, 2019
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::InputWrapperandUnicorn::StreamInputdon't respond to#eof?. This means that in development and on Unicorn, multipart parsing will fail for chunked requests.This change refactors the multipart parser so that it doesn't call
#eof?.