Skip to content

Commit

Permalink
Add inspect symbol for request
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 22, 2022
1 parent 0f99768 commit 49a0267
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/next/server/web/spec-extension/cookies.ts
Expand Up @@ -55,6 +55,9 @@ export class Cookies extends Map<string, string> {
)
)
}
[Symbol.for('edge-runtime.inspect.custom')]() {
return Object.fromEntries(this.entries())
}
}

export class NextCookies extends Cookies {
Expand Down
10 changes: 10 additions & 0 deletions packages/next/server/web/spec-extension/request.ts
Expand Up @@ -31,6 +31,16 @@ export class NextRequest extends Request {
}
}

[Symbol.for('edge-runtime.inspect.custom')]() {
return {
cookies: this.cookies,
geo: this.geo,
ip: this.ip,
nextUrl: this.nextUrl,
url: this.url,
}
}

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

0 comments on commit 49a0267

Please sign in to comment.