-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove copy of body headers into request headers #1755
Conversation
90782e6
to
47df373
Compare
I do not think this is good solution. I think default expectation is to have content-disposition header if you send file. What if we change attachment to inline type? That should solve your problem |
Thank you for your rapid answer 😃 I'm not sure to understand the necessity of From what I read on the Amazon S3 docs and the W3C specs, this is meant for clients to present the data differently (like changing a file name). Because this is not part of the HTTP specs, this is a nice to have, in my opinion. Hence, forcing this header as a default on POST/PUT requests doesn't seem natural to me. Moreover, this might also represent a security risk. For example, one may not want to share the actual file name stored on a local disk. I also don't see a way filter out this header (with |
aiohttp adds this header only if you send file object. I'll replace attachment with inline for 2.0.4 release |
Sounds good to me. Let's go with this plan! |
@kxepal what do you think about @JohanLorenzo another option is to drop content-disposition for non-multipart requests |
Dropping it for non-multiparts makes sense to me. |
+1 to drop. This header is not what to add for the requests. It's the server response header. |
ok, then I'll leave attachment as default, and will drop content-disposition from stream |
fixed in 2.0 and master. will release new version later today |
2.0.4 is released |
Thank you :) |
Thank you for this library! Mozilla uses aiohttp to upload artifacts on Amazon S3.
We recently migrated to 2.0.0, which gave this particular side-effect: mozilla-releng/scriptworker#98. We noticed 'Content-Disposition' is now added to PUT request that contain a data payload (like a text/plain document). This has the unwanted effect to confuse Firefox when downloading artifacts from S3. Before then, artifacts could be directly displayed in browser, but now they are considered as blobs to be downloaded.
I found headers are now extended by the ones detected from the body. in d69838a. I'm not sure what was the context at the time.
What do these changes do?
With this patch, body headers are not included in the actual headers of a request. Based on d69838a, this was the behavior before this commit.
What do you think @fafhrd91 ?
Are there changes in behavior for the user?
That fixes a regression from 1.x.
Related issue number
Checklist
I think the code is well written
(Side note: I just deleted some lines 😃 )
Unit tests for the changes exist
It seems this particular area wasn't tested. I haven't changed the tests.
Documentation reflects the changes
I'm not sure if changes are needed in the docs.
If you provide code modification, please add yourself to
CONTRIBUTORS.txt
Add a new entry to
CHANGES.rst