Skip to content

Commit

Permalink
Merge pull request #15 from ericclemmons/15-circular-JSON
Browse files Browse the repository at this point in the history
TypeError: Converting circular structure to JSON
  • Loading branch information
ericclemmons committed Apr 19, 2019
2 parents 186efb8 + 23fa2f5 commit 4bc0c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,13 @@ export class Recorder {
response?: ResponseRecording
) {
// Poor-man's clone for immutability
const request = JSON.parse(JSON.stringify(interceptedRequest));
const { body, headers, method, options } = request;
const headers = JSON.parse(JSON.stringify(interceptedRequest.headers));
const { body, method, options } = interceptedRequest;
const href = this.getHrefFromOptions(options);
const url = new URL(href, true);

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

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

0 comments on commit 4bc0c07

Please sign in to comment.