diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-20 10:13:30 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-20 10:13:30 -1000 |
commit | d4ebc65ac4f4a72c0ae1bd9cd5aa1fc7c7f5b22e (patch) | |
tree | 3299fa3c503606c4bf20f6b221d2ad2fb3cbc8d6 /lib | |
parent | 9cdce1f0fa8e7969eb1ab545e716b4630ae1ec68 (diff) | |
download | patchfoo-d4ebc65ac4f4a72c0ae1bd9cd5aa1fc7c7f5b22e.tar.gz patchfoo-d4ebc65ac4f4a72c0ae1bd9cd5aa1fc7c7f5b22e.zip |
Handle escaped blob ids
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js index a68d815..0e497ea 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -32,7 +32,7 @@ module.exports = Serve var emojiDir = path.join(require.resolve('emoji-named-characters'), '../pngs') var hlCssDir = path.join(require.resolve('highlight.js'), '../../styles') -var urlIdRegex = /^(?:\/+(([%&@]|%25)(?:[A-Za-z0-9\/+]|%2[Ff]|%2[Bb]){43}(?:=|%3D)\.(?:sha256|ed25519))([^?]*)?|(\/.*?))(?:\?(.*))?$/ +var urlIdRegex = /^(?:\/+(([%&@]|%25|%26)(?:[A-Za-z0-9\/+]|%2[Ff]|%2[Bb]){43}(?:=|%3D)\.(?:sha256|ed25519))([^?]*)?|(\/.*?))(?:\?(.*))?$/ function ctype(name) { switch (name && /[^.\/]*$/.exec(name)[0] || 'html') { @@ -282,6 +282,7 @@ Serve.prototype.handle = function () { case '%25': m[2] = '%'; m[1] = decodeURIComponent(m[1]) case '%': return this.id(m[1], m[3]) case '@': return this.userFeed(m[1], m[3]) + case '%26': m[2] = '%'; m[1] = decodeURIComponent(m[1]) case '&': return this.blob(m[1], m[3]) default: return this.path(m[4]) } |