Commit 7b1296a17c686246a78705ff9f4d90b54c294c86
Allow any ref to be url-encoded
cel committed on 4/16/2017, 5:47:55 PMParent: 187cf5d8c031e8ecdfeb9cecd02b4cb1c42f5105
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -88,10 +88,13 @@ | |||
88 | 88 … | ||
89 | 89 … | if (req.url.startsWith('/user-feed/')) return serveUserFeed(req, res, m[4]) | |
90 | 90 … | else if (req.url.startsWith('/channel/')) return serveChannel(req, res, m[4]) | |
91 | 91 … | ||
92 … | + if (m[2] && m[2].length === 3) { | ||
93 … | + m[1] = decodeURIComponent(m[1]) | ||
94 … | + m[2] = m[1][0] | ||
95 … | + } | ||
92 | 96 … | switch (m[2]) { | |
93 | - case '%25': m[2] = '%'; m[1] = decodeURIComponent(m[1]) | ||
94 | 97 … | case '%': return serveId(req, res, m[1], m[3], m[5]) | |
95 | 98 … | case '@': return serveFeed(req, res, m[1], m[3], m[5]) | |
96 | 99 … | case '&': return serveBlob(req, res, sbot, m[1]) | |
97 | 100 … | default: return servePath(req, res, m[4]) |
Built with git-ssb-web