Skip to content

Conversation

@vzt7
Copy link
Contributor

@vzt7 vzt7 commented Dec 6, 2025

close #45

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/zpg6/better-auth-cloudflare@46

commit: d73429e

Copy link

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 415 (Unsupported Media Type) error occurring during R2 file uploads by passing allowedMediaTypes metadata to the upload endpoint. The fix converts file extensions from the configuration into MIME types that can be validated by the better-auth framework.

  • Adds MIME type conversion using the mime/lite package
  • Passes allowedMediaTypes metadata to the upload endpoint configuration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/r2.ts Converts configured file extensions to MIME types and passes them as allowedMediaTypes metadata to the upload endpoint to enable proper content-type validation
package.json Adds mime package (v4.1.0) as a dependency for MIME type conversion functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zpg6 zpg6 merged commit 477d2c3 into zpg6:main Dec 6, 2025
11 checks passed
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.

Failed to upload file with status 415 (Unsupported Media Type)

2 participants