-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support for proxy authentication from proxy URL user info
closes: #6247 Signed-off-by: Steve Hawkins <[email protected]> Signed-off-by: Marc Nuri <[email protected]>
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,18 @@ void testConfigureSocksProxy() throws Exception { | |
Mockito.verify(builder).proxyAddress(new InetSocketAddress("192.168.0.1", 8080)); | ||
} | ||
|
||
@Test | ||
void testConfigureProxyAuth() throws Exception { | ||
Config config = new ConfigBuilder().withMasterUrl("http://localhost").withHttpProxy("http://user:[email protected]:8080") | ||
.build(); | ||
Builder builder = Mockito.mock(HttpClient.Builder.class, Mockito.RETURNS_SELF); | ||
|
||
HttpClientUtils.configureProxy(config, builder); | ||
|
||
Mockito.verify(builder).proxyType(HttpClient.ProxyType.HTTP); | ||
Mockito.verify(builder).proxyAuthorization("Basic dXNlcjpwYXNzd29yZA=="); | ||
} | ||
|
||
@Test | ||
void testCreateApplicableInterceptors() { | ||
// Given | ||
|