From 9e82aab85818c467168560987b8ce1977d29b6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Thu, 23 Feb 2012 20:33:01 +0100 Subject: [PATCH] use relative path for redirects avoiding problems with reverse proxies --- node/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/server.js b/node/server.js index a6a57497..f254c2ca 100644 --- a/node/server.js +++ b/node/server.js @@ -98,7 +98,7 @@ async.waterfall([ //the pad id was sanitized, so we redirect to the sanitized version if(sanitizedPadId != padId) { - var real_path = req.path.replace(/^\/p\/[^\/]+/, '/p/' + sanitizedPadId); + var real_path = req.path.replace(/^\/p\/[^\/]+/, './' + sanitizedPadId); res.header('Location', real_path); res.send('You should be redirected to ' + real_path + '', 302); }