Skip to content

Commit fe5122f

Browse files
committed
Merge pull request #225 from n3utrino/master
use HTTP status instead of string comparison
2 parents 720e568 + 6f92ea0 commit fe5122f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/notnoop/apns/internal/TlsTunnelBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Socket makeTunnel(String host, int port, String proxyUsername,
100100
if (socket == null) {
101101
ConnectMethod method = response.getConnectMethod();
102102
// Read the proxy's HTTP response.
103-
if(method.getStatusLine().toString().matches("HTTP/1\\.\\d 407 Proxy Authentication Required")) {
103+
if(method.getStatusLine().getStatusCode() == 407) {
104104
// Proxy server returned 407. We will now try to connect with auth Header
105105
if(proxyUsername != null && proxyPassword != null) {
106106
socket = AuthenticateProxy(method, client,proxyHost, proxyAddress.getPort(),

0 commit comments

Comments
 (0)