Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for RFC 2231 #726

Merged
merged 9 commits into from Jun 13, 2015
Merged

Fixes for RFC 2231 #726

merged 9 commits into from Jun 13, 2015

Conversation

sigmavirus24
Copy link
Contributor

No description provided.

@tenderlove
Copy link
Member

Can you rebase this please? Thank you!

@sigmavirus24
Copy link
Contributor Author

On it

sigmavirus24 and others added 9 commits June 13, 2015 14:19
I love working at the #OSL
* Broken quotes needs to be checked before RFC2231 otherwise the filenames are
  not correctly found

* Parsing "files" out of the header was converted to an empty string instead
  instead of nil when the body was empty.

I love working at the #OSL
@sigmavirus24
Copy link
Contributor Author

Done

tenderlove added a commit that referenced this pull request Jun 13, 2015
@tenderlove tenderlove merged commit df05b3a into rack:master Jun 13, 2015
@sigmavirus24
Copy link
Contributor Author

✨ 🍰 ✨

@tenderlove
Copy link
Member

Thanks. Would you mind running the tests? This PR is generating warnings with the new regexps:

/Users/aaron/git/rack/lib/rack/multipart.rb:31: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:32: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:32: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:33: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:33: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:34: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:34: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:34: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:34: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:35: warning: nested repeat operator + and ? was replaced with '*'
/Users/aaron/git/rack/lib/rack/multipart.rb:35: warning: nested repeat operator + and ? was replaced with '*'

@sigmavirus24
Copy link
Contributor Author

That's interesting, I don't remember seeing those before. I'll take a look at them tonight. Sorry about that

@tenderlove
Copy link
Member

No problem! It might just be against trunk Ruby (Ruby 2.3)

@sigmavirus24
Copy link
Contributor Author

On Sat, Jun 13, 2015 at 03:36:31PM -0700, Aaron Patterson wrote:

No problem! It might just be against trunk Ruby (Ruby 2.3)

Nah, it shows up in Travis-CI for 2.2 too. I don't think I had 2.2 installed
last year when I worked on this.

@sigmavirus24
Copy link
Contributor Author

So I took a look at this tonight finally. The interesting thing is that on L31 of lib/rack/multipart.rb if I change

EXTENDED_INITIAL_VALUE = /(?:[a-zA-Z0-9\-]+)?'(?:[a-zA-Z0-9\-]+)?'(?:#{EXTENDED_OTHER_VALUE}+)/

to

EXTENDED_INITIAL_VALUE = /(?:#{EXTENDED_OTHER_VALUE}+)/

Those warnings disappear. I'm toying around in rubular to see if I can find an equivalent regular expression to make Ruby 2.2 happy.

@sigmavirus24
Copy link
Contributor Author

So, the warnings go away (but the tests fail) if we do:

EXTENDED_INITIAL_VALUE = /([a-zA-Z0-9\-]+)?'([a-zA-Z0-9\-]+)?'(#{EXTENDED_OTHER_VALUE}+)/

But in reality, we don't need to capture those matches individually.

@sigmavirus24
Copy link
Contributor Author

@tenderlove here's the fix: #892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants