Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Ignore invalid Content-Disposition header #2284

Merged
merged 2 commits into from Aug 24, 2016
Merged

Ignore invalid Content-Disposition header #2284

merged 2 commits into from Aug 24, 2016

Conversation

arokettu
Copy link
Contributor

Here is one way to fix #2283

@@ -29,8 +29,8 @@ def content_type_from_content

def filename_from_content_disposition
if @content.meta.has_key?("content-disposition")
@content.meta["content-disposition"].
match(/filename="([^"]*)"/)[1]
matches = @content.meta["content-disposition"].match(/filename="([^"]*)"/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [82/80]

@tute
Copy link
Contributor

tute commented Aug 23, 2016

There is no behavior change now. Does this fix #2283?

@arokettu
Copy link
Contributor Author

Yes, the exception is now gone

@tute tute merged commit a49c59f into thoughtbot:master Aug 24, 2016
@tute
Copy link
Contributor

tute commented Aug 24, 2016

Thank you!

@maletor
Copy link

maletor commented Feb 14, 2017

Is it possible we are almost ready to cut a new release with this regression fix?

@jbielick
Copy link

Is there a chance this could be backported to 4.3?

@phbernard
Copy link

As an aside, a Content-Disposition is allowed to not contain a filename component. So strictly speaking this fix is not only for "invalid Content-Disposition", making it even more useful.

I backup @maletor, it would be great to have a new release with this fix.

This was referenced Dec 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NoMethodFound exception on invalid Content-Disposition header
6 participants