Skip to content

Commit 23fa2f5

Browse files
committed
Only clone headers, not entire interceptedRequest
1 parent 186efb8 commit 23fa2f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Recorder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ export class Recorder {
486486
response?: ResponseRecording
487487
) {
488488
// Poor-man's clone for immutability
489-
const request = JSON.parse(JSON.stringify(interceptedRequest));
490-
const { body, headers, method, options } = request;
489+
const headers = JSON.parse(JSON.stringify(interceptedRequest.headers));
490+
const { body, method, options } = interceptedRequest;
491491
const href = this.getHrefFromOptions(options);
492492
const url = new URL(href, true);
493493

494494
// fThis is redundant with `href`, so why should we keep it?
495-
delete request.headers.host;
495+
delete headers.host;
496496

497497
// Remove ephemeral ports from superagent testing
498498
// ! user-agent can be "..." or ["..."]

0 commit comments

Comments
 (0)