Commit 0dc90679c2621a5b112229ca9441babff47814c9
URl decode paths
cel committed on 5/6/2018, 4:28:20 PMParent: 251cad6b3e0549f13c40d70578843e19c481fadf
Files changed
dat.dpi | changed |
dat.dpi | ||
---|---|---|
@@ -359,9 +359,12 @@ | ||
359 | 359 … | |
360 | 360 … | DpiReq.prototype.serve = function () { |
361 | 361 … | var self = this |
362 | 362 … | if (self.closed) return |
363 | - self.stat(self.urlp.pathname || '/', function (err, st) { | |
363 … | + var pathname = self.urlp.pathname || '/' | |
364 … | + try { pathname = decodeURIComponent(pathname) } | |
365 … | + catch(e) {} | |
366 … | + self.stat(pathname, function (err, st) { | |
364 | 367 … | if (err) return self.serveNotFound(err) |
365 | 368 … | self.pathname = st.pathname |
366 | 369 … | if (self.urlp.query.stat) return self.serveStat(st) |
367 | 370 … | if (st.isDirectory()) return self.serveDirectory() |
Built with git-ssb-web