File tree Expand file tree Collapse file tree 4 files changed +16
-19
lines changed
main/java/io/split/client/dtos
test/java/io/split/client Expand file tree Collapse file tree 4 files changed +16
-19
lines changed Original file line number Diff line number Diff line change 22
33import org .apache .hc .core5 .http .HttpHost ;
44
5+ import java .net .MalformedURLException ;
56import java .net .URL ;
67
78public class ProxyConfiguration {
@@ -39,8 +40,12 @@ public ProxyConfiguration.Builder credentialsProvider(ProxyCredentialsProvider p
3940 return this ;
4041 }
4142
42- public ProxyConfiguration .Builder url (URL url ) {
43- _proxyHost = new HttpHost (url .getProtocol (), url .getHost (), url .getPort ());
43+ public ProxyConfiguration .Builder url (URL url ) throws MalformedURLException {
44+ try {
45+ _proxyHost = new HttpHost (url .getProtocol (), url .getHost (), url .getPort ());
46+ } catch (Exception exc ) {
47+ throw new MalformedURLException ("roxy configuration is ignored. The proxy `url` was not provided or is malformed" );
48+ }
4449 return this ;
4550 }
4651
Original file line number Diff line number Diff line change @@ -324,6 +324,15 @@ public void cannotUseInvalidHttpScheme() throws MalformedURLException {
324324 .build ();
325325 }
326326
327+ @ Test (expected = MalformedURLException .class )
328+ public void cannotUseInvalidUrl () throws MalformedURLException {
329+ SplitClientConfig .builder ()
330+ .proxyConfiguration (new ProxyConfiguration .Builder ()
331+ .url (new URL ("" ))
332+ .build ())
333+ .build ();
334+ }
335+
327336 @ Test (expected = IllegalArgumentException .class )
328337 public void mustUseP12FileWithProxyMtls () throws MalformedURLException {
329338 SplitClientConfig .builder ()
Original file line number Diff line number Diff line change 11package io .split .client ;
22
3- import io .split .client .dtos .BearerCredentialsProvider ;
43import io .split .client .dtos .ProxyConfiguration ;
54import io .split .client .impressions .ImpressionsManager ;
65import io .split .client .utils .FileTypeEnum ;
Original file line number Diff line number Diff line change 5353 <id >ossrh</id >
5454 <url >https://oss.sonatype.org/content/repositories/releases</url >
5555 </repository >
56- <repository >
57- <id >maven-all-virtual</id >
58- <url >https://splitio.jfrog.io/artifactory/maven-all-virtual</url >
59- </repository >
6056 </repositories >
6157 <pluginRepositories >
62- <pluginRepository >
63- <id >maven-all-virtual</id >
64- <url >https://splitio.jfrog.io/artifactory/maven-all-virtual</url >
65- </pluginRepository >
6658 </pluginRepositories >
6759 <properties >
6860 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
146138 <profile >
147139 <id >test</id >
148140 <distributionManagement >
149- <repository >
150- <id >maven-dev</id >
151- <url >https://splitio.jfrog.io/artifactory/maven-dev/</url >
152- </repository >
153- <snapshotRepository >
154- <id >maven-dev</id >
155- <url >https://splitio.jfrog.io/artifactory/maven-dev/</url >
156- </snapshotRepository >
157141 </distributionManagement >
158142 <build >
159143 <plugins >
You can’t perform that action at this time.
0 commit comments