File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ class AppBloc with AppSystemTray {
142142 _replaceLeakItemInChecklist (item);
143143 try {
144144 final url = Uri .parse (item.url);
145- final response = await _client.get (url).timeout (const Duration (seconds: 10 ));
145+ final response = await _client.head (url).timeout (const Duration (seconds: 10 ));
146146 if (response.statusCode == 200 ) {
147147 item.status = LeakStatus .passed;
148148 } else {
@@ -201,7 +201,7 @@ class AppBloc with AppSystemTray {
201201 try {
202202 _isPingingGoogle = true ;
203203 final url = Uri .parse ('https://google.com' );
204- await _client.get (url).timeout (const Duration (seconds: 5 ));
204+ await _client.head (url).timeout (const Duration (seconds: 5 ));
205205 } on TimeoutException {
206206 _isPingingGoogle = false ;
207207 _checkNetworkConnectivity ();
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ class HttpUtils {
1313 HttpHeaders .connectionHeader: 'keep-alive' , // Ensure keep-alive headers
1414 });
1515 try {
16- await _dio.get (url).timeout (timeout); // just a warm up connection to get a reliable result
16+ await _dio.head (url).timeout (timeout); // just a warm up connection to get a reliable result
1717 final firstTime = DateTime .now ().millisecondsSinceEpoch;
18- final response = await _dio.get (url).timeout (timeout);
18+ final response = await _dio.head (url).timeout (timeout);
1919 final secondTime = DateTime .now ().millisecondsSinceEpoch;
2020 if (response.statusCode == 200 || response.statusCode == 204 ) {
2121 return (secondTime - firstTime).toDouble ();
You can’t perform that action at this time.
0 commit comments