next.js
96d540c7 - Allow matching against user-agent in rewrites that match headers (#48271)

Commit
2 years ago
Allow matching against user-agent in rewrites that match headers (#48271) This adds support for matching against the user-agent header when doing rewrites client side. Currently a rewrite like this will fail because the user-agent header is not provided, and so next.js tries to prevent infinite rewrites: ``` { source: '/:path*', destination: 'https://example.com/:path*', missing: [ { type: 'header', key: 'User-Agent', value: '.*(?:Electron).*' }, ], } ``` Adding in the user-agent header allows this rewrite to pass.
Author
Parents
Loading