-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Add support for route has field #22345
Comments
I wonder if the Next.js team has any specific usecases in mind for this!? 💡 |
This is mostly driven by complex enterprise needs where they might have to route certain requests based on a cookie existing or a header being set from an external system. In general you don't need it in a basic Next.js application. |
### Related Issues x-ref: vercel/next.js#22341 x-ref: vercel/next.js#22345 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [x] The code changed/added as part of this PR has been covered with tests - [x] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
This adds support for a `has` field to `rewrites`, `redirects`, and `headers` to allow matching against `header`, `cookie`, and `query` values. Documentation and additional tests for the feature is also added in this PR. Closes: #22345
This adds support for a `has` field to `rewrites`, `redirects`, and `headers` to allow matching against `header`, `cookie`, and `query` values. Documentation and additional tests for the feature is also added in this PR. Closes: vercel#22345
This adds support for a `has` field to `rewrites`, `redirects`, and `headers` to allow matching against `header`, `cookie`, and `query` values. Documentation and additional tests for the feature is also added in this PR. Closes: vercel#22345
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
A new custom routes field
has
should be added to match againstheader
,cookie
, andquery
values. Currently only paths are allowed to matched against, adding thehas
field allows for more specific custom routes matching. The following shape will be used:Both the
source
and allhas
fields must be matched for the custom route to be applied.The text was updated successfully, but these errors were encountered: