-
Notifications
You must be signed in to change notification settings - Fork 167
fix cookie redirect matcher #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -22,14 +22,14 @@ const routeHasMatcher = | |||
switch (redirect.type) { | |||
case "header": | |||
return ( | |||
headers?.[redirect.key.toLowerCase()] !== "" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@conico974 Should this be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to be updated as well, but i think we should do something like
headers?.[redirect.key.toLowerCase()] && headers?.[redirect.key.toLowerCase()] !== ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!headers?.[redirect.key.toLowerCase()]
should take care of both those conditions right? undefined
and empty string will both be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@conico974 gonna merge this unless I should make your suggested changes.
#263 Should solve this issue |
What is the ETA for merging this? |
There's 3 issues we'd like to get in for 2.2.2, not sure when that will get released, perhaps this week. |
Thank you |
@khuezy Why was it reverted? |
If you click on the revert PR, there's a description there: #267 The test app: https://github.com/sst/open-next/blob/main/examples/app-router/next.config.js 13.5.6 test run: https://github.com/sst/open-next/actions/runs/6568405904/job/17842773477 |
When
cookie['key-does-not-exist-and-will-be-undefined']
, the cookie matcher logic would returntrue
becauseundefined !== ""
See:
cookies?.[redirect.key] !== ""