The code example in the sendDefaultPii deprecation section shows httpHeaders as a flat CollectBehavior value:
httpHeaders: { deny: ["forwarded", "-ip", "remote-", "via", "-user"] },
But the actual DataCollection TypeScript type (verified in @sentry/core@10.64.0) defines httpHeaders as a nested per-direction object:
httpHeaders?: {
request?: CollectBehavior;
response?: CollectBehavior;
};
Passing { deny: [...] } directly causes a TypeScript error because deny is not a valid key on { request?, response? }.
Workaround — use the nested form:
httpHeaders: {
request: { deny: ["forwarded", "-ip", "remote-", "via", "-user"] },
response: { deny: ["forwarded", "-ip", "remote-", "via", "-user"] },
},
cookies and queryParams use CollectBehavior directly and are correct in the example. Only httpHeaders is wrong.
--
View Junior Session in Sentry
The code example in the
sendDefaultPiideprecation section showshttpHeadersas a flatCollectBehaviorvalue:But the actual
DataCollectionTypeScript type (verified in@sentry/core@10.64.0) defineshttpHeadersas a nested per-direction object:Passing
{ deny: [...] }directly causes a TypeScript error becausedenyis not a valid key on{ request?, response? }.Workaround — use the nested form:
cookiesandqueryParamsuseCollectBehaviordirectly and are correct in the example. OnlyhttpHeadersis wrong.--
View Junior Session in Sentry