getsentry / getsentry/sentry-javascript

HTTP Headers are not sent by default, unless `sendDefaultPii` is enabled.

未关闭
#20,706 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Docs
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
515

描述

### SDK

JavaScript SDK

### Description

Sentry version:
```
"@sentry/browser": "10.51.0",
"@sentry/nextjs": "10.51.0",
```

The docs mention [here](https://docs.sentry.io/platforms/javascript/guides/nextjs/data-management/data-collected/#http-headers) that

> By default, the Sentry SDK sends HTTP response or request headers.

However, this is not true or needs clarifying since at least the NextJS SDK requires the SentryConfig to have `sendDefaultPii` to be true.

Response headers;
`sendDefaultPii` disabled;
Image

`sendDefaultPii` enabled;
Image

Request headers do seem to send headers but with some entries omitted, though this isn't mentioned on the docs.

### Suggested Solution

Depending what the expected behavior is here;

- If we do not expect to send headers by default, the docs should be updated here to mention that `sendDefaultPii` should be enabled for response headers and most request headers.
- If we do expect to send headers by default, there may be a bug in the Sentry JavaScript SDK.

Also, it would be useful to understand what exactly is and isn't included behind the `sendDefaultPii` field to make a decision if we should enable this or not. Perhaps also linking to the data-collected page from the interface/config API [here](https://docs.sentry.io/platforms/javascript/configuration/options/#sendDefaultPii).

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。