Skip to content

Commit b0554a8

Browse files
Fixed the unexpected warning on Android (#1097)
"Unsupported proxy version (0). Falling back to HTTP(0)." This warning may occur when we selected to not use a proxy Relates-To: OLPEDGE-2356 Signed-off-by: Andrey Kashcheev <[email protected]>
1 parent e1256aa commit b0554a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

olp-cpp-sdk-core/src/http/android/HttpClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ public Request(
116116
this.proxyPort = proxyPort;
117117

118118
switch (proxyType) {
119+
case 0:
120+
this.proxyType = Proxy.Type.DIRECT;
121+
break;
119122
case 1:
120123
this.proxyType = Proxy.Type.HTTP;
121124
break;
@@ -189,7 +192,7 @@ public final boolean hasProxy() {
189192
}
190193

191194
public final boolean noProxy() {
192-
return hasProxy() && this.proxyServer.equals("No");
195+
return (hasProxy() && this.proxyServer.equals("No")) || this.proxyType == Proxy.Type.DIRECT;
193196
}
194197

195198
public final int maxRetries() {

0 commit comments

Comments
 (0)