Skip to content

Commit 16eeb5b

Browse files
committed
remove that port from the pattern (when is that ever useful?)
Signed-off-by: Michael Sprauer <[email protected]>
1 parent 25bf89c commit 16eeb5b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/middleware/serveProxies.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eavily inspired by https://github.com/SAP/connect-openui5/blob/master/lib/proxy.js
1+
// heavily inspired by https://github.com/SAP/connect-openui5/blob/master/lib/proxy.js
22
const url = require("url");
33
const httpProxy = require("http-proxy");
44

@@ -9,14 +9,18 @@ const env = {
99
};
1010

1111
function getProxyUri(uri) {
12+
console.log("1", env)
1213
if (uri.protocol === "https:" && env.httpsProxy || uri.protocol === "http:" && env.httpProxy) {
13-
if (env.noProxy) {
14+
console.log("2")
15+
if (env.noProxy) {console.log("3")
1416
const canonicalHost = uri.host.replace(/^\.*/, ".");
1517
const port = uri.port || (uri.protocol === "https:" ? "443" : "80");
1618

1719
const patterns = env.noProxy.split(",");
1820
for (let i = patterns.length - 1; i >= 0; i--) {
21+
console.log("4")
1922
let pattern = patterns[i].trim().toLowerCase();
23+
console.log(canonicalHost, pattern)
2024

2125
// don"t use a proxy at all
2226
if (pattern === "*") {
@@ -26,11 +30,7 @@ function getProxyUri(uri) {
2630
// Remove leading * and make sure to have exact one leading dot (.)
2731
pattern = pattern.replace(/^[*]+/, "").replace(/^\.*/, ".");
2832

29-
// add port if no specified
30-
if (pattern.indexOf(":") === -1) {
31-
pattern += ":" + port;
32-
}
33-
33+
console.log(canonicalHost, pattern)
3434
// if host ends with pattern, no proxy should be used
3535
if (canonicalHost.indexOf(pattern) === canonicalHost.length - pattern.length) {
3636
return null;

0 commit comments

Comments
 (0)