Skip to content

Commit

Permalink
Workaround for #321
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Oct 11, 2023
1 parent 3886d0e commit 4a34a3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/driver/NextDriver.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class NextDriver extends DefaultDriver implements NextApi {
})) as string | null
if (!url) return new Response('Not found', {status: 404})
const source = new URL(request.url)
// Next.js incorrectly reports 0.0.0.0 as the hostname if the server is
// listening on all interfaces
if (source.hostname === '0.0.0.0') source.hostname = 'localhost'
const location = new URL(url, source.origin)
draftMode().enable()
return new Response(`Redirecting...`, {
Expand Down

0 comments on commit 4a34a3e

Please sign in to comment.