Skip to content

Commit d6b8496

Browse files
jksduaIgorMinar
authored andcommitted
Added global flag to path replace function in handleRequest to allow more than one space (aka %20) in the name
1 parent 8982ebc commit d6b8496

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/web-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ StaticServlet.MimeMap = {
8686

8787
StaticServlet.prototype.handleRequest = function(req, res) {
8888
var self = this;
89-
var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/, function(match, hex){
89+
var path = ('./' + req.url.pathname).replace('//','/').replace(/%(..)/g, function(match, hex){
9090
return String.fromCharCode(parseInt(hex, 16));
9191
});
9292
var parts = path.split('/');

0 commit comments

Comments
 (0)