diff options
author | Mark Holmquist <mtraceur@member.fsf.org> | 2012-07-02 16:46:31 -0700 |
---|---|---|
committer | Mark Holmquist <mtraceur@member.fsf.org> | 2012-07-02 16:46:31 -0700 |
commit | 91ed1f57c5fb8fdb74e54a0ff065f3a5a06f045f (patch) | |
tree | 3125e93b07b49f89460a1ec371358239c92d2759 /src/node/hooks/express/padurlsanitize.js | |
parent | afa107e809d5cf4c9a407a8a481dc34e6e018a68 (diff) | |
download | etherpad-lite-91ed1f57c5fb8fdb74e54a0ff065f3a5a06f045f.zip |
Don't rewrite in a stupid way
Since we're already in the proper path for the pad, why worry
about it? Replacing the entire path of the URL with /p/padname may
have seemed like a good idea at the time, but really, for a 302 we
only need a relative pathname. This patch provides the proper way.
Diffstat (limited to 'src/node/hooks/express/padurlsanitize.js')
-rw-r--r-- | src/node/hooks/express/padurlsanitize.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/hooks/express/padurlsanitize.js b/src/node/hooks/express/padurlsanitize.js index 229d013d..24ec2c3d 100644 --- a/src/node/hooks/express/padurlsanitize.js +++ b/src/node/hooks/express/padurlsanitize.js @@ -15,7 +15,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { //the pad id was sanitized, so we redirect to the sanitized version if(sanitizedPadId != padId) { - var real_url = req.url.replace(/^\/p\/[^\/]+/, '/p/' + sanitizedPadId); + var real_url = sanitizedPadId; var query = url.parse(req.url).query; if ( query ) real_url += '?' + query; res.header('Location', real_url); |