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

support parsing of content disposition header with empty filename #496

Conversation

pugsiman
Copy link

@pugsiman pugsiman commented Jun 29, 2017

Currently http responses with header such as Content-Disposition: 'inline; filename="/" will cause an exception because '/'.split(/[\\\/]/).last will result in nil, which we later try to translate and get NoMethodError (undefined method 'tr' for nil:NilClass) raised.

Using rpartition allows to support that edge case while not breaking anything else(in this case filename will be an empty string, instead of nil)

@knu knu merged commit 7db937e into sparklemotion:master Jun 2, 2018
@knu
Copy link
Member

knu commented Jun 2, 2018

Thanks!

@pugsiman pugsiman deleted the fix_parsing_empty_filename_content_disposition branch June 6, 2018 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants