@sentry/react-router 10.70.0 → 10.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,8 @@ const wrapSentryHandleRequest = require('../server/wrapSentryHandleRequest.js');
12
12
  function injectTraceMetaTags(body) {
13
13
  const headClosingTag = "</head>";
14
14
  const reader = body.getReader();
15
+ const encoder = new TextEncoder();
16
+ const decoder = new TextDecoder();
15
17
  const stream = new ReadableStream({
16
18
  async pull(controller) {
17
19
  const { done, value } = await reader.read();
@@ -19,8 +21,7 @@ function injectTraceMetaTags(body) {
19
21
  controller.close();
20
22
  return;
21
23
  }
22
- const encoder = new TextEncoder();
23
- const html = value instanceof Uint8Array ? new TextDecoder().decode(value) : String(value);
24
+ const html = value instanceof Uint8Array ? decoder.decode(value, { stream: true }) : String(value);
24
25
  if (html.includes(headClosingTag)) {
25
26
  const modifiedHtml = html.replace(headClosingTag, `${core.getTraceMetaTags()}${headClosingTag}`);
26
27
  controller.enqueue(encoder.encode(modifiedHtml));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/cloudflare/index.ts"],"sourcesContent":["import { getTraceMetaTags } from '@sentry/core';\n\nexport * from '../client';\n\nexport { wrapSentryHandleRequest } from '../server/wrapSentryHandleRequest';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by transforming the ReadableStream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n * @param body - ReadableStream containing the HTML response body to modify\n * @returns A new ReadableStream with Sentry trace meta tags injected into the head section\n */\nexport function injectTraceMetaTags(body: ReadableStream): ReadableStream {\n const headClosingTag = '</head>';\n\n const reader = body.getReader();\n const stream = new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n controller.close();\n return;\n }\n\n const encoder = new TextEncoder();\n const html = value instanceof Uint8Array ? new TextDecoder().decode(value) : String(value);\n\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n\n controller.enqueue(encoder.encode(modifiedHtml));\n return;\n }\n\n controller.enqueue(encoder.encode(html));\n },\n });\n\n return stream;\n}\n"],"names":["getTraceMetaTags"],"mappings":";;;;;;;;;;;AAYO,SAAS,oBAAoB,IAAA,EAAsC;AACxE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAEvB,EAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,EAAA,MAAM,MAAA,GAAS,IAAI,cAAA,CAAe;AAAA,IAChC,MAAM,KAAK,UAAA,EAAY;AACrB,MAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,MAAM,OAAO,IAAA,EAAK;AAE1C,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,KAAA,EAAM;AACjB,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,MAAA,MAAM,IAAA,GAAO,KAAA,YAAiB,UAAA,GAAa,IAAI,WAAA,GAAc,MAAA,CAAO,KAAK,CAAA,GAAI,MAAA,CAAO,KAAK,CAAA;AAEzF,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAGA,qBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAE1F,QAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,YAAY,CAAC,CAAA;AAC/C,QAAA;AAAA,MACF;AAEA,MAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,IACzC;AAAA,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/cloudflare/index.ts"],"sourcesContent":["import { getTraceMetaTags } from '@sentry/core';\n\nexport * from '../client';\n\nexport { wrapSentryHandleRequest } from '../server/wrapSentryHandleRequest';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by transforming the ReadableStream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n * @param body - ReadableStream containing the HTML response body to modify\n * @returns A new ReadableStream with Sentry trace meta tags injected into the head section\n */\nexport function injectTraceMetaTags(body: ReadableStream): ReadableStream {\n const headClosingTag = '</head>';\n\n const reader = body.getReader();\n const encoder = new TextEncoder();\n // A single streaming decoder carries incomplete multi-byte sequences across chunk\n // boundaries. A fresh, non-streaming decoder per chunk would flush a split character\n // as U+FFFD, corrupting the response (see https://github.com/whatwg/encoding/issues/184).\n const decoder = new TextDecoder();\n const stream = new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n controller.close();\n return;\n }\n\n const html = value instanceof Uint8Array ? decoder.decode(value, { stream: true }) : String(value);\n\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n\n controller.enqueue(encoder.encode(modifiedHtml));\n return;\n }\n\n controller.enqueue(encoder.encode(html));\n },\n });\n\n return stream;\n}\n"],"names":["getTraceMetaTags"],"mappings":";;;;;;;;;;;AAYO,SAAS,oBAAoB,IAAA,EAAsC;AACxE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAEvB,EAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAIhC,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,MAAM,MAAA,GAAS,IAAI,cAAA,CAAe;AAAA,IAChC,MAAM,KAAK,UAAA,EAAY;AACrB,MAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,MAAM,OAAO,IAAA,EAAK;AAE1C,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,KAAA,EAAM;AACjB,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,IAAA,GAAO,KAAA,YAAiB,UAAA,GAAa,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA,GAAI,MAAA,CAAO,KAAK,CAAA;AAEjG,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAGA,qBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAE1F,QAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,YAAY,CAAC,CAAA;AAC/C,QAAA;AAAA,MACF;AAEA,MAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,IACzC;AAAA,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,15 +5,16 @@ const core = require('@sentry/core');
5
5
 
6
6
  function getMetaTagTransformer(body) {
7
7
  const headClosingTag = "</head>";
8
+ const decoder = new TextDecoder();
8
9
  const htmlMetaTagTransformer = new node_stream.Transform({
9
10
  transform(chunk, _encoding, callback) {
10
- const html = Buffer.isBuffer(chunk) ? chunk.toString() : String(chunk);
11
+ const html = Buffer.isBuffer(chunk) ? decoder.decode(chunk, { stream: true }) : String(chunk);
11
12
  if (html.includes(headClosingTag)) {
12
13
  const modifiedHtml = html.replace(headClosingTag, `${core.getTraceMetaTags()}${headClosingTag}`);
13
14
  callback(null, modifiedHtml);
14
15
  return;
15
16
  }
16
- callback(null, chunk);
17
+ callback(null, html);
17
18
  }
18
19
  });
19
20
  htmlMetaTagTransformer.pipe(body);
@@ -1 +1 @@
1
- {"version":3,"file":"getMetaTagTransformer.js","sources":["../../../src/server/getMetaTagTransformer.ts"],"sourcesContent":["import type { PassThrough } from 'node:stream';\nimport { Transform } from 'node:stream';\nimport { getTraceMetaTags } from '@sentry/core';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by piping through a transform stream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n *\n * @param body - PassThrough stream containing the HTML response body to modify\n */\nexport function getMetaTagTransformer(body: PassThrough): Transform {\n const headClosingTag = '</head>';\n const htmlMetaTagTransformer = new Transform({\n transform(chunk, _encoding, callback) {\n const html = Buffer.isBuffer(chunk) ? chunk.toString() : String(chunk);\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n callback(null, modifiedHtml);\n return;\n }\n callback(null, chunk);\n },\n });\n htmlMetaTagTransformer.pipe(body);\n return htmlMetaTagTransformer;\n}\n"],"names":["Transform","getTraceMetaTags"],"mappings":";;;;;AAUO,SAAS,sBAAsB,IAAA,EAA8B;AAClE,EAAA,MAAM,cAAA,GAAiB,SAAA;AACvB,EAAA,MAAM,sBAAA,GAAyB,IAAIA,qBAAA,CAAU;AAAA,IAC3C,SAAA,CAAU,KAAA,EAAO,SAAA,EAAW,QAAA,EAAU;AACpC,MAAA,MAAM,IAAA,GAAO,OAAO,QAAA,CAAS,KAAK,IAAI,KAAA,CAAM,QAAA,EAAS,GAAI,MAAA,CAAO,KAAK,CAAA;AACrE,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAGC,qBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAC1F,QAAA,QAAA,CAAS,MAAM,YAAY,CAAA;AAC3B,QAAA;AAAA,MACF;AACA,MAAA,QAAA,CAAS,MAAM,KAAK,CAAA;AAAA,IACtB;AAAA,GACD,CAAA;AACD,EAAA,sBAAA,CAAuB,KAAK,IAAI,CAAA;AAChC,EAAA,OAAO,sBAAA;AACT;;;;"}
1
+ {"version":3,"file":"getMetaTagTransformer.js","sources":["../../../src/server/getMetaTagTransformer.ts"],"sourcesContent":["import type { PassThrough } from 'node:stream';\nimport { Transform } from 'node:stream';\nimport { getTraceMetaTags } from '@sentry/core';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by piping through a transform stream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n *\n * @param body - PassThrough stream containing the HTML response body to modify\n */\nexport function getMetaTagTransformer(body: PassThrough): Transform {\n const headClosingTag = '</head>';\n // A single streaming decoder carries incomplete multi-byte sequences across chunk\n // boundaries. Decoding each chunk on its own (e.g. `Buffer.toString()`) would flush a\n // split character as U+FFFD, corrupting the response (see\n // https://github.com/whatwg/encoding/issues/184).\n const decoder = new TextDecoder();\n const htmlMetaTagTransformer = new Transform({\n transform(chunk, _encoding, callback) {\n const html = Buffer.isBuffer(chunk) ? decoder.decode(chunk, { stream: true }) : String(chunk);\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n callback(null, modifiedHtml);\n return;\n }\n callback(null, html);\n },\n });\n htmlMetaTagTransformer.pipe(body);\n return htmlMetaTagTransformer;\n}\n"],"names":["Transform","getTraceMetaTags"],"mappings":";;;;;AAUO,SAAS,sBAAsB,IAAA,EAA8B;AAClE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAKvB,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,MAAM,sBAAA,GAAyB,IAAIA,qBAAA,CAAU;AAAA,IAC3C,SAAA,CAAU,KAAA,EAAO,SAAA,EAAW,QAAA,EAAU;AACpC,MAAA,MAAM,IAAA,GAAO,MAAA,CAAO,QAAA,CAAS,KAAK,IAAI,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA,GAAI,OAAO,KAAK,CAAA;AAC5F,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAGC,qBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAC1F,QAAA,QAAA,CAAS,MAAM,YAAY,CAAA;AAC3B,QAAA;AAAA,MACF;AACA,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA;AAAA,IACrB;AAAA,GACD,CAAA;AACD,EAAA,sBAAA,CAAuB,KAAK,IAAI,CAAA;AAChC,EAAA,OAAO,sBAAA;AACT;;;;"}
@@ -10,6 +10,8 @@ export { wrapSentryHandleRequest } from '../server/wrapSentryHandleRequest.js';
10
10
  function injectTraceMetaTags(body) {
11
11
  const headClosingTag = "</head>";
12
12
  const reader = body.getReader();
13
+ const encoder = new TextEncoder();
14
+ const decoder = new TextDecoder();
13
15
  const stream = new ReadableStream({
14
16
  async pull(controller) {
15
17
  const { done, value } = await reader.read();
@@ -17,8 +19,7 @@ function injectTraceMetaTags(body) {
17
19
  controller.close();
18
20
  return;
19
21
  }
20
- const encoder = new TextEncoder();
21
- const html = value instanceof Uint8Array ? new TextDecoder().decode(value) : String(value);
22
+ const html = value instanceof Uint8Array ? decoder.decode(value, { stream: true }) : String(value);
22
23
  if (html.includes(headClosingTag)) {
23
24
  const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);
24
25
  controller.enqueue(encoder.encode(modifiedHtml));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/cloudflare/index.ts"],"sourcesContent":["import { getTraceMetaTags } from '@sentry/core';\n\nexport * from '../client';\n\nexport { wrapSentryHandleRequest } from '../server/wrapSentryHandleRequest';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by transforming the ReadableStream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n * @param body - ReadableStream containing the HTML response body to modify\n * @returns A new ReadableStream with Sentry trace meta tags injected into the head section\n */\nexport function injectTraceMetaTags(body: ReadableStream): ReadableStream {\n const headClosingTag = '</head>';\n\n const reader = body.getReader();\n const stream = new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n controller.close();\n return;\n }\n\n const encoder = new TextEncoder();\n const html = value instanceof Uint8Array ? new TextDecoder().decode(value) : String(value);\n\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n\n controller.enqueue(encoder.encode(modifiedHtml));\n return;\n }\n\n controller.enqueue(encoder.encode(html));\n },\n });\n\n return stream;\n}\n"],"names":[],"mappings":";;;;;;;;;AAYO,SAAS,oBAAoB,IAAA,EAAsC;AACxE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAEvB,EAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,EAAA,MAAM,MAAA,GAAS,IAAI,cAAA,CAAe;AAAA,IAChC,MAAM,KAAK,UAAA,EAAY;AACrB,MAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,MAAM,OAAO,IAAA,EAAK;AAE1C,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,KAAA,EAAM;AACjB,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,MAAA,MAAM,IAAA,GAAO,KAAA,YAAiB,UAAA,GAAa,IAAI,WAAA,GAAc,MAAA,CAAO,KAAK,CAAA,GAAI,MAAA,CAAO,KAAK,CAAA;AAEzF,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAG,gBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAE1F,QAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,YAAY,CAAC,CAAA;AAC/C,QAAA;AAAA,MACF;AAEA,MAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,IACzC;AAAA,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/cloudflare/index.ts"],"sourcesContent":["import { getTraceMetaTags } from '@sentry/core';\n\nexport * from '../client';\n\nexport { wrapSentryHandleRequest } from '../server/wrapSentryHandleRequest';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by transforming the ReadableStream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n * @param body - ReadableStream containing the HTML response body to modify\n * @returns A new ReadableStream with Sentry trace meta tags injected into the head section\n */\nexport function injectTraceMetaTags(body: ReadableStream): ReadableStream {\n const headClosingTag = '</head>';\n\n const reader = body.getReader();\n const encoder = new TextEncoder();\n // A single streaming decoder carries incomplete multi-byte sequences across chunk\n // boundaries. A fresh, non-streaming decoder per chunk would flush a split character\n // as U+FFFD, corrupting the response (see https://github.com/whatwg/encoding/issues/184).\n const decoder = new TextDecoder();\n const stream = new ReadableStream({\n async pull(controller) {\n const { done, value } = await reader.read();\n\n if (done) {\n controller.close();\n return;\n }\n\n const html = value instanceof Uint8Array ? decoder.decode(value, { stream: true }) : String(value);\n\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n\n controller.enqueue(encoder.encode(modifiedHtml));\n return;\n }\n\n controller.enqueue(encoder.encode(html));\n },\n });\n\n return stream;\n}\n"],"names":[],"mappings":";;;;;;;;;AAYO,SAAS,oBAAoB,IAAA,EAAsC;AACxE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAEvB,EAAA,MAAM,MAAA,GAAS,KAAK,SAAA,EAAU;AAC9B,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAIhC,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,MAAM,MAAA,GAAS,IAAI,cAAA,CAAe;AAAA,IAChC,MAAM,KAAK,UAAA,EAAY;AACrB,MAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,MAAM,OAAO,IAAA,EAAK;AAE1C,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,UAAA,CAAW,KAAA,EAAM;AACjB,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,IAAA,GAAO,KAAA,YAAiB,UAAA,GAAa,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA,GAAI,MAAA,CAAO,KAAK,CAAA;AAEjG,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAG,gBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAE1F,QAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,YAAY,CAAC,CAAA;AAC/C,QAAA;AAAA,MACF;AAEA,MAAA,UAAA,CAAW,OAAA,CAAQ,OAAA,CAAQ,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,IACzC;AAAA,GACD,CAAA;AAED,EAAA,OAAO,MAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.70.0"}
1
+ {"type":"module","version":"10.71.0"}
@@ -3,15 +3,16 @@ import { getTraceMetaTags } from '@sentry/core';
3
3
 
4
4
  function getMetaTagTransformer(body) {
5
5
  const headClosingTag = "</head>";
6
+ const decoder = new TextDecoder();
6
7
  const htmlMetaTagTransformer = new Transform({
7
8
  transform(chunk, _encoding, callback) {
8
- const html = Buffer.isBuffer(chunk) ? chunk.toString() : String(chunk);
9
+ const html = Buffer.isBuffer(chunk) ? decoder.decode(chunk, { stream: true }) : String(chunk);
9
10
  if (html.includes(headClosingTag)) {
10
11
  const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);
11
12
  callback(null, modifiedHtml);
12
13
  return;
13
14
  }
14
- callback(null, chunk);
15
+ callback(null, html);
15
16
  }
16
17
  });
17
18
  htmlMetaTagTransformer.pipe(body);
@@ -1 +1 @@
1
- {"version":3,"file":"getMetaTagTransformer.js","sources":["../../../src/server/getMetaTagTransformer.ts"],"sourcesContent":["import type { PassThrough } from 'node:stream';\nimport { Transform } from 'node:stream';\nimport { getTraceMetaTags } from '@sentry/core';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by piping through a transform stream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n *\n * @param body - PassThrough stream containing the HTML response body to modify\n */\nexport function getMetaTagTransformer(body: PassThrough): Transform {\n const headClosingTag = '</head>';\n const htmlMetaTagTransformer = new Transform({\n transform(chunk, _encoding, callback) {\n const html = Buffer.isBuffer(chunk) ? chunk.toString() : String(chunk);\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n callback(null, modifiedHtml);\n return;\n }\n callback(null, chunk);\n },\n });\n htmlMetaTagTransformer.pipe(body);\n return htmlMetaTagTransformer;\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,sBAAsB,IAAA,EAA8B;AAClE,EAAA,MAAM,cAAA,GAAiB,SAAA;AACvB,EAAA,MAAM,sBAAA,GAAyB,IAAI,SAAA,CAAU;AAAA,IAC3C,SAAA,CAAU,KAAA,EAAO,SAAA,EAAW,QAAA,EAAU;AACpC,MAAA,MAAM,IAAA,GAAO,OAAO,QAAA,CAAS,KAAK,IAAI,KAAA,CAAM,QAAA,EAAS,GAAI,MAAA,CAAO,KAAK,CAAA;AACrE,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAG,gBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAC1F,QAAA,QAAA,CAAS,MAAM,YAAY,CAAA;AAC3B,QAAA;AAAA,MACF;AACA,MAAA,QAAA,CAAS,MAAM,KAAK,CAAA;AAAA,IACtB;AAAA,GACD,CAAA;AACD,EAAA,sBAAA,CAAuB,KAAK,IAAI,CAAA;AAChC,EAAA,OAAO,sBAAA;AACT;;;;"}
1
+ {"version":3,"file":"getMetaTagTransformer.js","sources":["../../../src/server/getMetaTagTransformer.ts"],"sourcesContent":["import type { PassThrough } from 'node:stream';\nimport { Transform } from 'node:stream';\nimport { getTraceMetaTags } from '@sentry/core';\n\n/**\n * Injects Sentry trace meta tags into the HTML response by piping through a transform stream.\n * This enables distributed tracing by adding trace context to the HTML document head.\n *\n * @param body - PassThrough stream containing the HTML response body to modify\n */\nexport function getMetaTagTransformer(body: PassThrough): Transform {\n const headClosingTag = '</head>';\n // A single streaming decoder carries incomplete multi-byte sequences across chunk\n // boundaries. Decoding each chunk on its own (e.g. `Buffer.toString()`) would flush a\n // split character as U+FFFD, corrupting the response (see\n // https://github.com/whatwg/encoding/issues/184).\n const decoder = new TextDecoder();\n const htmlMetaTagTransformer = new Transform({\n transform(chunk, _encoding, callback) {\n const html = Buffer.isBuffer(chunk) ? decoder.decode(chunk, { stream: true }) : String(chunk);\n if (html.includes(headClosingTag)) {\n const modifiedHtml = html.replace(headClosingTag, `${getTraceMetaTags()}${headClosingTag}`);\n callback(null, modifiedHtml);\n return;\n }\n callback(null, html);\n },\n });\n htmlMetaTagTransformer.pipe(body);\n return htmlMetaTagTransformer;\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,sBAAsB,IAAA,EAA8B;AAClE,EAAA,MAAM,cAAA,GAAiB,SAAA;AAKvB,EAAA,MAAM,OAAA,GAAU,IAAI,WAAA,EAAY;AAChC,EAAA,MAAM,sBAAA,GAAyB,IAAI,SAAA,CAAU;AAAA,IAC3C,SAAA,CAAU,KAAA,EAAO,SAAA,EAAW,QAAA,EAAU;AACpC,MAAA,MAAM,IAAA,GAAO,MAAA,CAAO,QAAA,CAAS,KAAK,IAAI,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA,GAAI,OAAO,KAAK,CAAA;AAC5F,MAAA,IAAI,IAAA,CAAK,QAAA,CAAS,cAAc,CAAA,EAAG;AACjC,QAAA,MAAM,YAAA,GAAe,KAAK,OAAA,CAAQ,cAAA,EAAgB,GAAG,gBAAA,EAAkB,CAAA,EAAG,cAAc,CAAA,CAAE,CAAA;AAC1F,QAAA,QAAA,CAAS,MAAM,YAAY,CAAA;AAC3B,QAAA;AAAA,MACF;AACA,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA;AAAA,IACrB;AAAA,GACD,CAAA;AACD,EAAA,sBAAA,CAAuB,KAAK,IAAI,CAAA;AAChC,EAAA,OAAO,sBAAA;AACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cloudflare/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CA4BxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cloudflare/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAgCxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMetaTagTransformer.d.ts","sourceRoot":"","sources":["../../../src/server/getMetaTagTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAelE"}
1
+ {"version":3,"file":"getMetaTagTransformer.d.ts","sourceRoot":"","sources":["../../../src/server/getMetaTagTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAoBlE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/react-router",
3
- "version": "10.70.0",
3
+ "version": "10.71.0",
4
4
  "description": "Official Sentry SDK for React Router (Framework)",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react-router",
@@ -47,12 +47,12 @@
47
47
  "dependencies": {
48
48
  "@opentelemetry/api": "^1.9.1",
49
49
  "@opentelemetry/instrumentation": "^0.220.0",
50
- "@sentry/browser": "10.70.0",
50
+ "@sentry/browser": "10.71.0",
51
51
  "@sentry/cli": "^2.58.6",
52
52
  "@sentry/conventions": "^0.16.0",
53
- "@sentry/core": "10.70.0",
54
- "@sentry/node": "10.70.0",
55
- "@sentry/react": "10.70.0",
53
+ "@sentry/core": "10.71.0",
54
+ "@sentry/node": "10.71.0",
55
+ "@sentry/react": "10.71.0",
56
56
  "@sentry/vite-plugin": "^5.3.0",
57
57
  "glob": "^13.0.6"
58
58
  },