Skip to content

Commit

Permalink
Merge pull request #13 from TheMisir/patch-1
Browse files Browse the repository at this point in the history
Update connectivity_util.dart
  • Loading branch information
Vanethos authored May 17, 2020
2 parents ab45f09 + c51d7d8 commit 2e78f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/connectivity_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ConnectivityUtils {
/// Server to ping
///
/// The server to ping and check the response, can be set with [setServerToPing]
String _serverToPing = "http://www.google.com";
String _serverToPing = "http://www.gstatic.com/generate_204";

/// Verify Response Callback
///
Expand Down Expand Up @@ -90,7 +90,7 @@ class ConnectivityUtils {

// ignore: close_sinks
final result = await http.get(_serverToPing);
if (result.statusCode == 200 && _callback(result.body)) {
if (result.statusCode > 199 && result.statusCode < 400 && _callback(result.body)) {
return true;
}
} catch (e) {
Expand Down

0 comments on commit 2e78f83

Please sign in to comment.