Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae6dffb6 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Use getBoundURL for network validation.

Disable for now, until we're more confident that it doesn't choke
on strange captive portals.

Change-Id: Ic8e66a379d32c915c949df70ca0d38535cd5dbe0
parent 73f1856f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -617,8 +617,11 @@ public class NetworkMonitor extends StateMachine {
        int httpResponseCode = 599;
        try {
            URL url = new URL(urlString);
            // TODO: check that standard HttpURLConnection doesn't choke on
            // cruel and unusual captive portals, and then replace the
            // hand-rolled HTTP code in the else branch with this code.
            if (false) {
                // TODO: Need to add URLConnection.setNetwork() before we can enable.
                url = mNetworkAgentInfo.network.getBoundURL(url);
                urlConnection = (HttpURLConnection) url.openConnection();
                urlConnection.setInstanceFollowRedirects(false);
                urlConnection.setConnectTimeout(SOCKET_TIMEOUT_MS);