docs(workers): clarify Version-Overrides header works on service-binding subrequests#30733
Closed
thomsoncf wants to merge 1 commit into
Closed
Conversation
…ing subrequests Adds a paragraph and JS snippet to the Version overrides section clarifying that Cloudflare-Workers-Version-Overrides is honoured on subrequests made through a Worker-to-Worker service binding, but only when the calling Worker explicitly sets it on the subrequest. The neighbouring Version affinity section already documents the same behaviour for Cloudflare-Workers-Version-Key; this brings parity.
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
Adds a single paragraph + small JS snippet to the Version overrides section of the Gradual Deployments docs, clarifying that
Cloudflare-Workers-Version-Overridesis honoured on subrequests made through a Worker-to-Worker service binding — but only when the calling Worker explicitly sets the header on the subrequest.Why
The neighbouring Version affinity section already documents that
Cloudflare-Workers-Version-Keyworks on service-binding subrequests:The same is true of
Cloudflare-Workers-Version-Overrides, but the docs don't currently say so, which leads to repeat questions about whether the override header is honoured on service bindings.There is also a subtle difference worth surfacing: the override header is not automatically propagated through a service binding — the calling Worker must explicitly include it on the subrequest. This PR makes that explicit with a short JS example using
env.MY_SERVICE.fetch().Verified empirically
Set up two Workers in one account:
env.CALLEE.fetch().Out of scope
env.MY_SERVICE.someMethod()) — there is no API to attach headers per-call, so this PR doesn't address that case.