mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Merge branch 'develop' of git://github.com/Pita/etherpad-lite into restartserver
This commit is contained in:
commit
a0548af021
14 changed files with 320 additions and 41 deletions
|
@ -1,4 +1,5 @@
|
|||
var padManager = require('../../db/PadManager');
|
||||
var url = require('url');
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
//redirects browser to the pad's sanitized url if needed. otherwise, renders the html
|
||||
|
@ -14,9 +15,11 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
//the pad id was sanitized, so we redirect to the sanitized version
|
||||
if(sanitizedPadId != padId)
|
||||
{
|
||||
var real_path = req.path.replace(/^\/p\/[^\/]+/, '/p/' + sanitizedPadId);
|
||||
res.header('Location', real_path);
|
||||
res.send('You should be redirected to <a href="' + real_path + '">' + real_path + '</a>', 302);
|
||||
var real_url = sanitizedPadId;
|
||||
var query = url.parse(req.url).query;
|
||||
if ( query ) real_url += '?' + query;
|
||||
res.header('Location', real_url);
|
||||
res.send('You should be redirected to <a href="' + real_url + '">' + real_url + '</a>', 302);
|
||||
}
|
||||
//the pad id was fine, so just render it
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue