Skip to content

fix(cli): preserve signed upload content-type headers - #5253

Closed
user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/cloud-upload-content-type-casing
Closed

user-github-me wants to merge 1 commit into
heygen-com:mainfrom
user-github-me:fix/cloud-upload-content-type-casing

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

The direct-upload flow adds a lowercase content-type default before spreading the server’s signed headers. If the API returns Content-Type or another casing, fetch combines both values; a real HTTP request receives application/zip, application/zip, changing the header that the presigned request requires.

Add the ZIP default only when the normalized upload headers contain no content-type key, comparing names case-insensitively. Preserve the server’s values and casing and keep the existing handling of other headers.

Validation: 113 cloud/client and cloud-command tests pass. Five real HTTP upload cases cover title, uppercase, mixed, lowercase, and absent content-type keys; the first three fail on current main. The tests verify the received header value, one header entry, unchanged request bytes, and upload completion. A separate Node 22 HTTP probe confirms the duplicate value before and a single value after. CLI typecheck, repository lint, formatting, and test reachability pass.

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks. We checked the server side, and the direct-upload endpoint always returns upload_headers with a lowercase content-type key, so the spread already overrides the default and no duplicate value is sent. Since the mixed-case scenario can't occur with the current API, we don't think this change is needed. — Rames

@jrusso1020 jrusso1020 closed this Oct 8, 2026
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.

2 participants