aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:43:19 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-06 16:43:19 -0700
commit1829a67120b0a82dfe130e5c5215475c8ac74d9f (patch)
tree286751ee8609e92ff6953cf9fc583b43f99a7c59 /lib/serve.js
parent1f165c468822356b7379f04ae20447dcaf79d918 (diff)
downloadpatchfoo-1829a67120b0a82dfe130e5c5215475c8ac74d9f.tar.gz
patchfoo-1829a67120b0a82dfe130e5c5215475c8ac74d9f.zip
Quote blob filenames better.
Fix %DPzqOq/f6/S9V1/ZRaIVoniRDJlbSNfC1mrW6IgfgDc=.sha256
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index ca6b2ae..d0e2e26 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -47,7 +47,8 @@ function ctype(name) {
}
function encodeDispositionFilename(fname) {
- return '"' + fname.replace(/\/g/, '\\\\').replace(/"/, '\\\"') + '"'
+ fname = fname.replace(/\/g/, '\\\\').replace(/"/, '\\\"')
+ return '"' + encodeURIComponent(fname) + '"'
}
function Serve(app, req, res) {