Accessing response headers in API routes of App Router? #83695
Unanswered
art-alexeyenko
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
API route handlers in Pages Router had access to both Request and Response objects, so you could read response headers like
Set-Cookie
,Access-Control-Allow-Origin
and others.App Router's GET, POST and other handler functions only accept a Request object.
Now,
NextRequest
type allows to accessSet-Cookie
. But what about other headers, like CORS set by next.config rules?Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions