| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cb2aed9 commit 9224427
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,7 +99,7 @@ function ipToInt(ip) { | |||
| 99 | 99 | /** | |
| 100 | 100 | * Represents the proxy configuration for an agent. The built-in http and https agent | |
| 101 | 101 | * implementation have one of this when they are configured to use a proxy. | |
| 102 | - * @property {string} href - Full URL of the proxy server. | ||
| 102 | + * @property {string} href - Proxy server URL with credentials redacted. | ||
| 103 | 103 | * @property {string} protocol - Proxy protocol used to talk to the proxy server. | |
| 104 | 104 | * @property {string|undefined} auth - proxy-authorization header value, if username or password is provided. | |
| 105 | 105 | * @property {Array<string>} bypassList - List of hosts to bypass the proxy. | |
@@ -115,7 +115,13 @@ class ProxyConfig { | |||
| 115 | 115 | } | |
| 116 | 116 | const { hostname, port, protocol, username, password } = parsedURL; | |
| 117 | 117 | ||
| 118 | - this.href = proxyUrl; | ||
| 118 | + if (username || password) { | ||
| 119 | + parsedURL.username = ''; | ||
| 120 | + parsedURL.password = ''; | ||
| 121 | + this.href = parsedURL.href; | ||
| 122 | + } else { | ||
| 123 | + this.href = proxyUrl; | ||
| 124 | + } | ||
| 119 | 125 | this.protocol = protocol; | |
| 120 | 126 | ||
| 121 | 127 | if (username || password) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,6 +53,9 @@ const { code, signal, stderr } = await runProxiedRequest({ | |||
| 53 | 53 | // The proxy client should get an error from proxy authentication failure. | |
| 54 | 54 | // Since the process exits cleanly but with an error, check for any error output | |
| 55 | 55 | assert.match(stderr, /407 Proxy Authentication Required/); | |
| 56 | + assert.match(stderr, /via http:\/\/localhost:\d+\/?/); | ||
| 57 | + assert.doesNotMatch(stderr, /baduser/); | ||
| 58 | + assert.doesNotMatch(stderr, /badpass/); | ||
| 56 | 59 | assert.strictEqual(code, 0); | |
| 57 | 60 | assert.strictEqual(signal, null); | |
| 58 | 61 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments