Skip to content

fix(desktop): avoid duplicate content type in signed uploads - #3463

Open
bestgopher wants to merge 1 commit into
CapSoftware:mainfrom
my-contributes:fix
Open

bestgopher wants to merge 1 commit into
CapSoftware:mainfrom
my-contributes:fix

Conversation

@bestgopher

@bestgopher bestgopher commented Oct 27, 2026 •

Copy link
Copy Markdown

Native Instant uploads add a local Content-Type and then append the same header from the signed upload target. RustFS 1.0.3 rejects these PUTs with 400 InvalidRequest: duplicate header: content-type, leaving manifest, metadata, and thumbnail uploads incomplete even after video segments have uploaded.

Use the server-provided content type when present, matching header names case-insensitively, and infer a MIME type only when it is absent. Extract request construction for regression tests covering header casing, supplied MIME precedence, fallback types, additional headers, request bodies, and Google Drive content ranges.

Validation:

  • Two regression tests extracted with the production request builder fail against the original construction and pass with this fix using reqwest 0.12.28.
  • Real Cap-signed RustFS PUTs for a native recording's manifest, metadata JSON, and JPEG thumbnail returned 200 OK with the fixed builder.
  • Scoped formatting and git diff --check passed.

Full desktop cargo check is blocked by a missing local zed-cap checkout. The complete patched GUI has not yet been rebuilt and retested; the real upload verification used the extracted production request builder.

Closes #3462

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Prevents duplicate Content-Type headers in native signed uploads.

  • Signed uploads use the target's content type when it provides one.

No actionable issues found. Review was static; tests were not run.

Reviews (1) · Last reviewed commit: "fix(desktop): avoid duplicate content ty..." · Reviewed by Greptile

Use the server-provided Content-Type when present and infer a fallback
only when it is absent, matching header names case-insensitively.
This prevents RustFS from rejecting Instant metadata and thumbnail PUTs
with InvalidRequest due to duplicate Content-Type headers.

Extract request construction for regression tests covering header casing,
fallback MIME types, additional headers, and Google Drive content ranges.

Validation: two extracted regression tests and real RustFS uploads pass.
Full desktop cargo check is blocked by the missing local zed-cap checkout.

Closes CapSoftware#3462
Fixes:[CapSoftware#3462]

Signed-off-by: bestgopher <84328409@qq.com>
@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@bestgopher is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

Native Instant uploads send duplicate Content-Type headers, failing on some S3-compatible backends

1 participant