fix(blob): switch to private access with auth-gated delivery route#1482
Closed
fix(blob): switch to private access with auth-gated delivery route#1482
Conversation
User-uploaded images are auth-gated content that should not be publicly accessible. This switches from public to private blob storage and adds a delivery route that checks the user's session before serving files. Changes: - Upload route: access: 'public' -> 'private', returns delivery route URL - New /api/files/serve route: auth-gated, streams private blobs with ETag support - next.config.ts: remove public blob domain from remotePatterns
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
Reopening with branch name without slashes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
User-uploaded images are auth-gated content that should not be publicly accessible. This switches from public to private blob storage and adds a delivery route that checks the user's session before serving files.
Changes:
access: "public"->access: "private", returns/api/files/serve?pathname=...instead of raw blob URL/api/files/serveroute: checks auth, streams private blob with ETag caching support*.public.blob.vercel-storage.comfromnext.config.tsimage patterns (no longer needed)No client changes needed — the upload response interface (
{ url, pathname, contentType }) is preserved, andnext/imageworks with same-origin URLs withoutremotePatterns.Context
Aligns with the private-by-default direction for Vercel Blob (see vercel/front#65379, vercel/vercel#15375). The CLI now defaults to private-first prompts and requires explicit
--accessflags.🤖 Generated with Claude Code