aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-01-30 23:48:46 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-01-30 23:48:46 -0500
commitc662791505f014d95b3db7961e9c476f9b695ed4 (patch)
tree744776cf08c694b60ead1fd639d113686ba8545f
parent7a3b67c49b20c9063a696b8fb7dc00e541855693 (diff)
downloadpatchfoo-c662791505f014d95b3db7961e9c476f9b695ed4.tar.gz
patchfoo-c662791505f014d95b3db7961e9c476f9b695ed4.zip
Trim extra leading slashes
-rw-r--r--lib/serve.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js
index e85ca31..df2b089 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -113,6 +113,7 @@ Serve.prototype.respondSink = function (status, headers, cb) {
Serve.prototype.path = function (url) {
var m
+ url = url.replace(/^\/+/, '/')
switch (url) {
case '/': return this.home()
case '/robots.txt': return this.res.end('User-agent: *')