fix: prevent double https:// in R2 public URLs #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The
CLOUDFLARE_R2_URLenvironment variable already includes the protocol prefix (https://), as shown in the README examples:However, the code in
src/lib/r2.ts:49was prepending anotherhttps://, resulting in malformed URLs like:Solution
Remove the hardcoded
https://prefix and use the environment variable value directly.Changes
src/lib/r2.ts: Updated public URL construction to not prepend protocolCLOUDFLARE_R2_URLalready includes protocolImpact
This fixes image uploads that would have failed due to invalid URLs being stored in the database.
🤖 Generated with Claude Code