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

Content-type headers are overriden when using put_attachment #132

Open
Louis-T opened this issue Apr 5, 2017 · 1 comment
Open

Content-type headers are overriden when using put_attachment #132

Louis-T opened this issue Apr 5, 2017 · 1 comment

Comments

@Louis-T
Copy link

Louis-T commented Apr 5, 2017

Hi,

Thanks for this gem, it's quite useful.
I noticed that when using the put_attachment method (put_attachment(doc, 'nameWithoutExtension', image, content_type: 'image/jpeg')), the Content-type header is always set to text/plain.

I solved this slight problem locally by modifying the payload_from_doc to take into account the existing req[:header]['Content-Type'].

I don't know if it's wanted or not, but it can be problematic when using a name without extension.

@omensinger
Copy link

I stumbled across the same problem. Method "payload_from_doc" (in "connection.rb") overwrites the header in line "req[:header]['Content-Type'] = mime_for(req[:uri].path)", for whatever reason.

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

No branches or pull requests

2 participants