Skip to content

fix: resolve mp3 upload error at api.ts:53 (issue #95)#109

Open
ErnestHysa wants to merge 1 commit into
freeman-jiang:mainfrom
ErnestHysa:fix/issue-95-mp3-upload-error
Open

fix: resolve mp3 upload error at api.ts:53 (issue #95)#109
ErnestHysa wants to merge 1 commit into
freeman-jiang:mainfrom
ErnestHysa:fix/issue-95-mp3-upload-error

Conversation

@ErnestHysa

Copy link
Copy Markdown

Summary

Fixes issue #95 - mp3 upload error at api.ts:53.

Root Cause

When uploading directly to R2 via a presigned URL, the client was sending a Content-Type header in the PUT request. However, presigned URLs already encode the content type in their signature. Including the header causes R2 to reject the upload with a signature mismatch error.

Fix

Removed the explicit Content-Type header from the fetch call when uploading to the presigned URL. The content type information is already embedded in the presigned URL itself.

Changes

  • apps/client/src/lib/api.ts: Removed headers: { Content-Type: data.file.type } from the presigned URL upload fetch call

Testing

This fix has been tested to resolve the mp3 upload failure.

…man-jiang#95)

The Content-Type header was being sent when uploading directly to R2 via a presigned URL. However, presigned URLs already encode the content type in the signature. Including the header can cause R2 to reject uploads with a signature mismatch error, particularly affecting MP3 uploads.
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

@ErnestHysa is attempting to deploy a commit to the freemanjiang's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ErnestHysa

Copy link
Copy Markdown
Author

The Vercel deploy preview needs team authorization from a maintainer on freemanjiang's projects — not something I can do from my end. The code change is just the Content-Type header removal in apps/client/src/lib/api.ts; once a maintainer authorizes, the preview should run.

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.

1 participant