We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b02fd6d commit ec7d824Copy full SHA for ec7d824
servor.js
@@ -152,7 +152,8 @@ module.exports = async ({
152
// Start the server and route requests
153
154
server((req, res) => {
155
- const pathname = decodeURI(url.parse(req.url).pathname);
+ const decodePathname = decodeURI(url.parse(req.url).pathname);
156
+ const pathname = path.normalize(decodePathname).replace(/^(\.\.(\/|\\|$))+/, '');
157
res.setHeader('access-control-allow-origin', '*');
158
if (reload && pathname === '/livereload') return serveReload(res);
159
if (!isRouteRequest(pathname)) return serveStaticFile(res, pathname);
0 commit comments