Skip to content

Commit

Permalink
fix: decode URI before using it as path
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi committed Oct 26, 2022
1 parent d9ad406 commit 8380d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/Visual/http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const server = http.createServer(function (req, res) {
break;
}

fs.readFile(ROOT + req.url.replace(/\?[^?]+/, ''), function (err, data) {
fs.readFile(decodeURI(ROOT + req.url.replace(/\?[^?]+/, '')), function (err, data) {
if (err) {
console.error(err);
res.writeHead(404);
Expand Down

0 comments on commit 8380d3b

Please sign in to comment.