Repository navigation
fix(web): send no trace headers on outgoing server requests - #4191
Merged
Merged
Conversation
Server and edge tracing are off (tracesSampleRate 0), so the sentry-trace and baggage headers Sentry adds to outgoing requests are never used. Some of those requests go to customers' own servers, such as Cap Infra webhook deliveries, which then receive the release and project details those headers carry. tracePropagationTargets is now empty. Error reporting is unchanged, and browsers can still send the headers to Cap.
|
Sandchest reviewed Sandchest reviews every change for vulnerabilities an attacker could use · Review details |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
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.

Server and edge tracing are off:
tracesSampleRateis 0. Sentry still addssentry-traceandbaggageheaders to every outgoing request from those runtimes. Nothing reads them: the media server and the other services Cap calls don't use Sentry. Some outgoing requests go to customers' own servers, for example Cap Infra webhook deliveries, and those servers then receive the release and project details the headers carry.Change
tracePropagationTargets: []insentry.server.config.tsandsentry.edge.config.ts, so no outgoing request gets the headers.What stays the same:
Tests
sentry-server-propagation.test.tsloads both configs and checks the setting. It fails without the change. The existing Sentry browser filter test still passes.Proof on Vercel previews
I built two throwaway cap-web previews, one from main and one from this branch. Each had a temporary route that sent requests to a capture server I ran. The route and both branches are now deleted.
sendDeveloperWebhook(the real Infra webhook path, node:https)sentry-traceandbaggagesentfetchfrom a Node routesentry-traceandbaggagesentfetchfrom an Edge routeOn main,
baggagecarriedsentry-environment,sentry-release,sentry-public_key,sentry-trace_idandsentry-org_id. The Edge runtime sent no trace headers on main either, so on Edge the setting only keeps it that way. The webhook still delivered (200) with itscap-signature,cap-event-idandcap-event-typeheaders.Error reporting is unchanged. A test exception sent from the branch preview reached Sentry ingest with HTTP 200 on Node, the same as on main. On Edge,
afterSendEventfired on both builds with the same empty result.instrumentation-client.tsis not touched.The full apps/web unit suite gives the same result as main, plus the 2 new tests. The only failures are 7
share-stage-identitytests, which fail on main too.Production proof (after merge)
I checked this on production after deploy 083ef75 with a real Infra delivery, using no temporary route. A test app registered a webhook endpoint pointing at a receiver I ran, and I uploaded one clip. Exactly one
video.readyarrived 36.9 s into the run, and itscap-signatureverified. No secondvideo.readycame in the following 30 s. The earlierwebhook.testdelivery had the same headers. Both the endpoint and the video were deleted afterwards: the video now returns 404 and the endpoint is gone from the list.Header names received on
video.ready(names only):accept-encoding,cap-event-id,cap-event-type,cap-signature,cdn-loop,cf-connecting-ip,cf-ew-via,cf-ipcountry,cf-ray,cf-visitor,cf-warp-tag-id,cf-worker,connection,content-length,content-type,host,user-agent,x-forwarded-for,x-forwarded-proto,x-invocation-id,x-vercel-idThere was no
sentry-trace,baggageortraceparent. Thecf-*andcdn-loopheaders come from the tunnel in front of the receiver, not from Cap.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Sets
tracePropagationTargets: []in the Node and Edge Sentry configs to stop outgoing trace headers.Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile