Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cloudflare/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function getDefaultIntegrations(options: CloudflareOptions): Integration[
linkedErrorsIntegration(),
fetchIntegration(),
httpServerIntegration(),
// oxlint-disable-next-line typescript/no-deprecated
requestDataIntegration(cookiesEnabled ? undefined : { include: { cookies: false } }),
consoleIntegration(),
// The orchestrion diagnostics-channel subscribers (mysql, pg, …). The
Expand Down
10 changes: 9 additions & 1 deletion packages/core/src/integrations/requestdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ type RequestDataIncludeOptions = {

type RequestDataIntegrationOptions = {
/**
* Controls what data is pulled from the request and added to the event.
* Defines what request data should be collected.
*
* @deprecated Use `dataCollection` from the `init()` options instead. Check the docs for more info: https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection
*/
include?: RequestDataIncludeOptions;
};
Expand All @@ -44,13 +46,19 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) =
function resolveRequestDataOptions(client: Client): ResolvedRequestDataOptions {
const dataCollection = client.getDataCollectionOptions();
const include = {
// oxlint-disable-next-line typescript/no-deprecated
cookies: options.include?.cookies ?? dataCollection.cookies !== false,
// Always attach body data that's already on the scope — dataCollection.httpBodies gates write-time, not read-time
// oxlint-disable-next-line typescript/no-deprecated
data: options.include?.data ?? true,
// oxlint-disable-next-line typescript/no-deprecated
headers: options.include?.headers ?? dataCollection.httpHeaders.request !== false,
// oxlint-disable-next-line typescript/no-deprecated
ip: options.include?.ip ?? dataCollection.userInfo,
// oxlint-disable-next-line typescript/no-deprecated
query_string: options.include?.query_string ?? dataCollection.urlQueryParams !== false,
// No dataCollection equivalent — URL is always included
// oxlint-disable-next-line typescript/no-deprecated
url: options.include?.url ?? true,
};

Expand Down
Loading