Skip to content

Commit

Permalink
Use two argument URL constructor as suggested. Resolve the case of mi…
Browse files Browse the repository at this point in the history
…ssing req.url explicitly as a non-match, whereas previously url.pathname would have implicitly resolved to '/'.
  • Loading branch information
rhurmala committed Jan 30, 2025
1 parent 564b78a commit 70e86f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vike-node/src/plugin/plugins/devServerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ export function devServerPlugin(): Plugin {
}

function isHMRProxyRequest(req: IncomingMessage) {
const url = new URL(`http://example.com${req.url}`)
if (req.url === undefined) {
return false
}
const url = new URL(req.url, 'http://example.com')
return url.pathname === VITE_HMR_PATH
}
}
Expand Down

0 comments on commit 70e86f9

Please sign in to comment.