Merge pull request +11231 from c9/fix-open-redirects3

Fix open redirects3
smf-sdk
Lennart Kats 2015-12-22 11:10:26 +01:00
commit 4dc67d2c40
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -14,10 +14,10 @@ module.exports = function(options, imports, register) {
this.end("");
});
imports.connect.addResponseMethod("secureRedirect", function(location) {
var parsedLocation = url.parse(location);
var parsedLocation = url.parse(location, false, true);
if (!trustedDomainsRe.test(parsedLocation.host))
location = parsedLocation.path;
location = parsedLocation.path || "/";
this.redirect(location);
});