We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ed3954f + f861d5c commit e349604Copy full SHA for e349604
test/webserver.js
@@ -85,6 +85,10 @@ WebServer.prototype = {
85
// `/../../../../../../../etc/passwd`, which let you make GET requests
86
// for files outside of `this.root`.
87
var pathPart = path.normalize(decodeURI(urlParts[1]));
88
+ // path.normalize returns a path on the basis of the current platform.
89
+ // Windows paths cause issues in statFile and serverDirectoryIndex.
90
+ // Converting to unix path would avoid platform checks in said functions.
91
+ pathPart = pathPart.replace(/\\/g, '/');
92
} catch (ex) {
93
// If the URI cannot be decoded, a `URIError` is thrown. This happens for
94
// malformed URIs such as `http://localhost:8888/%s%s` and should be
0 commit comments