Skip to content

Commit cf669b7

Browse files
committed
run lint
1 parent c374020 commit cf669b7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

frontend/vite-xss-middleware.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@ export function viteXssMiddleware(): Plugin {
66
const originalEnd = res.end;
77
const chunks: any[] = [];
88

9-
res.end = function(chunk?: any) {
9+
res.end = function (chunk?: any) {
1010
if (chunk) chunks.push(Buffer.from(chunk));
11-
11+
1212
const body = Buffer.concat(chunks).toString();
13-
13+
1414
// If Vite's error message is reflecting user input, replace it
1515
if (body.includes('did you mean to visit') && body.includes('<a href=')) {
16-
const safe =
17-
`<!DOCTYPE html>
16+
const safe = `<!DOCTYPE html>
1817
<html>
1918
<head><title>404 Not Found</title></head>
2019
<body><h1>404 - Page Not Found</h1></body>
2120
</html>`;
2221
res.setHeader('Content-Type', 'text/html');
2322
return originalEnd.call(res, safe);
2423
}
25-
24+
2625
return originalEnd.call(res, Buffer.concat(chunks));
2726
};
2827

@@ -38,4 +37,4 @@ export function viteXssMiddleware(): Plugin {
3837
server.middlewares.use(middleware);
3938
}
4039
};
41-
}
40+
}

0 commit comments

Comments
 (0)