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.pull/833/head
parent
afa107e809
commit
91ed1f57c5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue