fix: Adjust the decodeURIComponent function call as recommended

This commit is contained in:
xiaqiubo 2019-04-08 23:51:44 +08:00
parent e3f874d6c7
commit 419fa7e099

View File

@ -248,7 +248,7 @@ http.createServer(function (request, response) {
});
function serveFile(uri, request, response) {
var file = url.parse(decodeURIComponent(uri || request.url)).pathname;
var file = decodeURIComponent(url.parse(uri || request.url).pathname);
if (file === '/' || file === '') {
file = options.homepage;