Skip to content

Commit

Permalink
chore: make it a named function
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed May 8, 2023
1 parent 5d57541 commit 0e58633
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/server/index.ts
Expand Up @@ -609,7 +609,8 @@ export async function _createServer(
middlewares.use('/__open-in-editor', launchEditorMiddleware())

// ping request handler
middlewares.use((req, res, next) => {
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
middlewares.use(function viteHMRPingMiddleware(req, res, next) {
if (req.headers['accept'] === 'text/x-vite-ping') {
res.writeHead(204).end()
} else {
Expand Down

0 comments on commit 0e58633

Please sign in to comment.