forked from svrjs/svrjs
Fixed bug with URLs beginning with multiple slashes being rewritten incorrectly.
This commit is contained in:
parent
5339f4c244
commit
b829414f4c
1 changed files with 1 additions and 1 deletions
2
svr.js
2
svr.js
|
@ -3332,7 +3332,7 @@ if (!cluster.isPrimary) {
|
||||||
if (typeof URL !== "undefined" && url.Url) {
|
if (typeof URL !== "undefined" && url.Url) {
|
||||||
try {
|
try {
|
||||||
// Create a new URL object using the provided URI and base URL
|
// Create a new URL object using the provided URI and base URL
|
||||||
var uobject = new URL(uri, "http" + (req.socket.encrypted ? "s" : "") + "://" + (req.headers.host ? req.headers.host : (domain ? domain : "unknown.invalid")));
|
var uobject = new URL(uri.replace(/^\/{2,}/,"/"), "http" + (req.socket.encrypted ? "s" : "") + "://" + (req.headers.host ? req.headers.host : (domain ? domain : "unknown.invalid")));
|
||||||
|
|
||||||
// Create a new URL object (similar to deprecated url.Url)
|
// Create a new URL object (similar to deprecated url.Url)
|
||||||
var nuobject = new url.Url();
|
var nuobject = new url.Url();
|
||||||
|
|
Reference in a new issue