-
Notifications
You must be signed in to change notification settings - Fork 759
fix: take content type from PutObjectInput instead of headers #718
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
fix: take content type from PutObjectInput instead of headers #718
Conversation
|
Hi @DASPRiD , We need to wait for the automated tests to be completed. Also, there are CLA requirements and test case requirements on CI. |
|
Hey @loverustfs, what exactly is required, in regards to CLA? Also, where would the POST tests usually be placed? I couldn't find anything appropriate. |
|
It looks like the CI has passed. We will check and get back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where the Content-Type header was being incorrectly sourced from request headers for both PUT and POST requests. The fix ensures that Content-Type is taken from the PutObjectInput struct, which properly handles the different sources (HTTP header for PUT, form field for POST).
Key changes:
- Added
skip_content_typeparameter to metadata extraction functions to prevent overwriting the content type fromPutObjectInput - Modified
put_objectto explicitly set content type fromPutObjectInputbefore extracting other metadata - Updated all test call sites with the new parameter
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| rustfs/src/storage/options.rs | Added skip_content_type parameter to metadata extraction functions and updated tests to pass the new parameter |
| rustfs/src/storage/ecfs.rs | Modified put_object to set content type from input before extracting metadata, passing skip_content_type=true to prevent override |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @DASPRiD , If your bug is fixed, we can merge this PR. In the future, we may refer to MinIO's solution for form uploads. Did this PR resolve your form upload issue? |
To be fair, this is not specifically about form uploads, but about signed uploads which allow to assign conditions like max filesize and other policies. That is not possible with signed PUT URLs. |
Thanks again. |
Type of Change
Related Issues
#716
Summary of Changes
This PR changes the
put_objectendpoint to take theContent-Typefrom thePutObjectInputstruct instead of trying to parse it from the request headers. This ensures that forPUTrequests the source is theContent-TypeHTTP header and forPOSTrequests it's theContent-Typeform field.Checklist
make pre-commitImpact
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.