Repository navigation
[@vercel/blob] Allow get() to fetch from a VERCEL_BLOB_API_URL origin - #1110
Merged
Merged
Conversation
get() only accepted URLs on *.blob.vercel-storage.com, which blocked local emulators that serve blob content from their own host. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d1a1576 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kldavis4
approved these changes
Oct 5, 2026
This branch was successfully deployed
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.
Problem
get()rejects any URL whose hostname isn't*.blob.vercel-storage.com. That check was added as an SSRF guard, but it also blocks local emulation: bothemulate(blob support) andvercel/blob-localserve blob content from their own host, soget(blob.url)throws before any request is made. Every other command (put,head,list,del) already works against an emulator because they route throughVERCEL_BLOB_API_URL.Raised by @scotttrinh in #help-cdn while adding Blob coverage to
emulate(#278) for the upcoming Python and Go SDKs.Solution
get()now also accepts URLs on the same origin as aVERCEL_BLOB_API_URL/NEXT_PUBLIC_VERCEL_BLOB_API_URLoverride. With no override set, nothing changes — arbitrary hosts, subdomain spoofing and plainlocalhostare all still rejected, so production behavior and the SSRF guard are untouched.Two things stay as they are, both because the SDK can't know an emulator's URL layout:
put/head, which is whatemulatealready resolves on its side.blob.pathnamekeeps the emulator's route prefix (vercel/blob/store_123/foo.txt, notfoo.txt), since it's derived from the URL path.Why: You couldn't read a blob back when pointing the SDK at a local emulator — writes worked, reads threw "the URL does not point to a Vercel Blob store". Now, if you've explicitly told the SDK where its API lives, reads from that same host are allowed too, which is what unblocks
emulateand keeps the Python SDK from having to hardcode the hostname check.No feature flag: this is an npm SDK, and the change is self-gating — it only takes effect when
VERCEL_BLOB_API_URLis set, which is already an opt-in for non-production use. Rollback is a version revert.🤖 Generated with Claude Code