Closed JanStevens closed 1 week ago
Hi,
I noticed in the logs that redirects to different domain results in a very odd constructed url.
In my next.config.js file I have the following defined
{ redirects: [ { source: '/events/beast-house/tickets', destination: 'https://nofomo.com/collections/beast-house', permanent: false, basePath: false, }, ] }
In the logs I see that protocol already returns https://
protocol
https://
INFO urlParts { pathname: '/collections/beast-house', protocol: 'https://', hostname: 'nofomo.com', queryString: '' } INFO value /en/events/beast-house/tickets INFO redirect { type: 'core', statusCode: 307, headers: { Location: 'https:////nofomo.com/collections/beast-house?eventSlug=beast-house&__nextDataReq=1' }, body: '', isBase64Encoded: false }
I think this is caused by this code (last 3 lines)
https://github.com/sst/open-next/blob/9d632d1bd5c3a8d7e7bbd13ae9daaca68da9284e/packages/open-next/src/core/routing/matcher.ts#L187-L220
Great catch!
Hi,
I noticed in the logs that redirects to different domain results in a very odd constructed url.
In my next.config.js file I have the following defined
In the logs I see that
protocol
already returnshttps://
I think this is caused by this code (last 3 lines)
https://github.com/sst/open-next/blob/9d632d1bd5c3a8d7e7bbd13ae9daaca68da9284e/packages/open-next/src/core/routing/matcher.ts#L187-L220