Unverified Commit 4443d6f3 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update has redirect examples (#25003)

This fixes an infinite redirect in the `has` redirect examples by ensuring not to match the redirect destination itself

## Documentation / Examples

- [x] Make sure the linting passes
parent 614f105b
...@@ -140,7 +140,7 @@ module.exports = { ...@@ -140,7 +140,7 @@ module.exports = {
// if the header `x-redirect-me` is present, // if the header `x-redirect-me` is present,
// this redirect will be applied // this redirect will be applied
{ {
source: '/:path*', source: '/:path((?!another-page$).*)',
has: [ has: [
{ {
type: 'header', type: 'header',
...@@ -170,12 +170,12 @@ module.exports = { ...@@ -170,12 +170,12 @@ module.exports = {
}, },
], ],
permanent: false, permanent: false,
destination: '/:path*/:page', destination: '/another/:path*',
}, },
// if the header `x-authorized` is present and // if the header `x-authorized` is present and
// contains a matching value, this redirect will be applied // contains a matching value, this redirect will be applied
{ {
source: '/:path*', source: '/',
has: [ has: [
{ {
type: 'header', type: 'header',
...@@ -189,7 +189,7 @@ module.exports = { ...@@ -189,7 +189,7 @@ module.exports = {
// if the host is `example.com`, // if the host is `example.com`,
// this redirect will be applied // this redirect will be applied
{ {
source: '/:path*', source: '/:path((?!another-page$).*)',,
has: [ has: [
{ {
type: 'host', type: 'host',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment