Skip to content

Conversation

@DASPRiD
Copy link
Contributor

@DASPRiD DASPRiD commented Oct 24, 2025

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

#716

Summary of Changes

This PR changes the put_object endpoint to take the Content-Type from the PutObjectInput struct instead of trying to parse it from the request headers. This ensures that for PUT requests the source is the Content-Type HTTP header and for POST requests it's the Content-Type form field.

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

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.

@loverustfs
Copy link
Contributor

Hi @DASPRiD ,

We need to wait for the automated tests to be completed. Also, there are CLA requirements and test case requirements on CI.
Thanks for your contribution!

@DASPRiD
Copy link
Contributor Author

DASPRiD commented Oct 24, 2025

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.

@loverustfs
Copy link
Contributor

It looks like the CI has passed. We will check and get back to you.

@houseme houseme requested a review from Copilot October 24, 2025 23:50
Copy link
Contributor

Copilot AI left a 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_type parameter to metadata extraction functions to prevent overwriting the content type from PutObjectInput
  • Modified put_object to explicitly set content type from PutObjectInput before 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.

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2025

CLA assistant check
All committers have signed the CLA.

@loverustfs
Copy link
Contributor

loverustfs commented Oct 26, 2025

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.

#716 (comment)

Did this PR resolve your form upload issue?
Are any other features affected?

@DASPRiD
Copy link
Contributor Author

DASPRiD commented Oct 26, 2025

If your bug is fixed, we can merge this PR. In the future, we may refer to MinIO's solution for form uploads.

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.

@loverustfs loverustfs merged commit 6f3d288 into rustfs:main Oct 26, 2025
12 checks passed
@loverustfs
Copy link
Contributor

If your bug is fixed, we can merge this PR. In the future, we may refer to MinIO's solution for form uploads.

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.

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.

3 participants