Skip to content

Commit

Permalink
Add inspect symbol for response
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 22, 2022
1 parent 49a0267 commit 198ae64
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/next/server/web/spec-extension/response.ts
Expand Up @@ -27,6 +27,22 @@ export class NextResponse extends Response {
}
}

[Symbol.for('edge-runtime.inspect.custom')]() {
return {
cookies: this.cookies,
url: this.url,
// rest of props come from Response
body: this.body,
bodyUsed: this.bodyUsed,
headers: Object.fromEntries(this.headers),
ok: this.ok,
redirected: this.redirected,
status: this.status,
statusText: this.statusText,
type: this.type,
}
}

public get cookies() {
return this[INTERNALS].cookies
}
Expand Down

0 comments on commit 198ae64

Please sign in to comment.