Comparing version 0.0.2 to 0.0.3
@@ -38,3 +38,7 @@ | ||
console.log('index- backendUrl: ', backendUrl); | ||
if (!parsedUrl.hostname) { | ||
//see if the url was encoded twice. | ||
backendUrl = decodeURIComponent(backendUrl); | ||
parsedUrl = url.parse(backendUrl); | ||
} | ||
@@ -41,0 +45,0 @@ //adjust the req object. |
@@ -5,3 +5,3 @@ { | ||
"main" : "index.js", | ||
"version" : "0.0.2", | ||
"version" : "0.0.3", | ||
"dependencies" : { | ||
@@ -8,0 +8,0 @@ "http-proxy" : "*" |
@@ -57,2 +57,13 @@ var assert = require('assert'), | ||
it('should proxy double encoded urls', function ( done ) { | ||
var url = encodeURIComponent('http://localhost:9000'); | ||
request | ||
.get({ | ||
uri: 'http://localhost:8000/proxy/' + url | ||
}, function ( err, res, body ) { | ||
assert.equal(body, "response from remote"); | ||
done(); | ||
}); | ||
}); | ||
it('should ignore urls outside /proxy/', function ( done ) { | ||
@@ -59,0 +70,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5765
128