Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,19 @@ protected final <T> T runQuery(Parser<T> parser, URL query, String acceptHeader,
}

code = conn instanceof HttpURLConnection ? ((HttpURLConnection) conn).getResponseCode() : HttpURLConnection.HTTP_OK;
if (code == HttpURLConnection.HTTP_PROXY_AUTH)
{
LOGGER.fine("Error with proxy. Second attempt after forcing acces to http website in first place.");
URI uritest= new URI("http://google.com");
URL urltest = uritest.toURL();
conn = urltest.openConnection(proxy);
((HttpURLConnection) conn).setRequestMethod("GET");
code = conn instanceof HttpURLConnection ? ((HttpURLConnection) conn).getResponseCode() : HttpURLConnection.HTTP_OK;
conn = url.openConnection(proxy);
((HttpURLConnection) conn).setRequestMethod("GET");
code = conn instanceof HttpURLConnection ? ((HttpURLConnection) conn).getResponseCode() : HttpURLConnection.HTTP_OK;

}
if (isRedirection(code))
{
URL redirection = getRedirectionURL(conn, code);
Expand Down