Commit ef4b4f342c9b73014f992041ce0a43c123f31146
Handle requests to unescaped ssb refs
e.g. image blobs referenced in markdown with slashes in their idCharles Lehner committed on 3/29/2016, 2:43:28 AM
Parent: 87a92b12f3bb2fcd5f7cf0890137360f32e0375d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -386,9 +386,11 @@ | ||
386 | 386 … | } |
387 | 387 … | |
388 | 388 … | function handleRequest(req) { |
389 | 389 … | var u = req._u = url.parse(req.url, true) |
390 | - var dirs = u.pathname.slice(1).split(/\/+/).map(tryDecodeURIComponent) | |
390 … | + var path = u.pathname.slice(1) | |
391 … | + var dirs = ref.isLink(path) ? [path] : | |
392 … | + path.split(/\/+/).map(tryDecodeURIComponent) | |
391 | 393 … | var dir = dirs[0] |
392 | 394 … | |
393 | 395 … | if (req.method == 'POST') { |
394 | 396 … | if (isPublic) |
Built with git-ssb-web