-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
Hi, I'd like to use better-auth-cloudflare with R2 bucket, but I got an error when uploading a file:
{"code": "UNSUPPORTED_MEDIA_TYPE", "message": "Content-Type is required. Allowed types: application/json", "status": 415, "statusText": "unsupported media type"}
Found the cause
A change related to allowedMediaTypes was introduced in [email protected].
Reference to the changes in better-auth: Commit 1412892
So we should add a metadata.allowedMediaTypes field on src/r2.ts#L519
How to resolve
Add the metadata.allowedMediaTypes field based on the r2.allowedTypes config field of better-auth-cloudflare.
I created a patch for this, see https://gist.github.com/vzt7/ce0b87972e56ab0cf4578a50c0aa3849
If this looks good, I'm glad to submit a PR
zpg6
Metadata
Metadata
Assignees
Labels
No labels