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 23cf049 commit d17d538Copy full SHA for d17d538
code/solutions/20_2_fixing_a_leak.js
@@ -2,7 +2,7 @@
2
// code/file_server_promises.js already contain this fixed version.
3
4
function urlToPath(url) {
5
- var path = url;
+ var path = require("url").parse(url).pathname;
6
var decoded = decodeURIComponent(path);
7
return "." + decoded.replace(/(\/|\\)\.\.(\/|\\|$)/g, "/");
8
}
0 commit comments