Skip to content

Commit

Permalink
fix: fix proxy handling
Browse files Browse the repository at this point in the history
  • Loading branch information
drallieiv committed May 22, 2017
1 parent 4fe1ec2 commit a67155b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public static HttpProxy fromURI(String uri) {
protocol = "http";
port = DEFAULT_PORT;
} else {
if (port < 0) {
if (protocol == null) {
// Guess port from Protocol
for (Entry<String, Integer> entry : DEFAULT_MAPPING.entrySet()) {
if (entry.getValue() == port) {
Expand All @@ -152,7 +152,7 @@ public static HttpProxy fromURI(String uri) {
if (protocol == null) {
protocol = DEFAULT_PROTOCOL;
}
} else if (protocol == null) {
} else if (port < 0) {
// Guess protocol from port
if (DEFAULT_MAPPING.get(protocol) != null) {
port = DEFAULT_MAPPING.get(protocol);
Expand Down

0 comments on commit a67155b

Please sign in to comment.