We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5ee428 commit 11cbbe5Copy full SHA for 11cbbe5
1 file changed
experimental/packages/opentelemetry-instrumentation-fetch/src/fetch.ts
@@ -507,8 +507,14 @@ export class FetchInstrumentation extends InstrumentationBase<FetchInstrumentati
507
const body = resClone.body;
508
if (body) {
509
const reader = body.getReader();
510
-
511
- const wrappedBody = withCancelPropagation(response.body, reader);
+ const isNullBodyStatus =
+ response.status === 101 ||
512
+ response.status === 204 ||
513
+ response.status === 205 ||
514
+ response.status === 304;
515
+ const wrappedBody = isNullBodyStatus
516
+ ? null
517
+ : withCancelPropagation(response.body, reader);
518
519
proxiedResponse = new Response(wrappedBody, {
520
status: response.status,
0 commit comments