additional http status code check

This commit is contained in:
Fabian Freund
2024-06-12 14:18:52 +02:00
parent 5338e7adbe
commit 22bf859ee0
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -82,9 +82,13 @@ class GenericWebsiteService extends _$GenericWebsiteService {
(result) => result.flatMapAsync(
(info) async {
if (info.favicon != null) {
return _client
.get(info.favicon!.url)
.then((response) => response.bodyBytes);
return _client.get(info.favicon!.url).then((response) {
if (response.statusCode == 200) {
return response.bodyBytes;
} else {
return null;
}
});
}
return null;
@@ -7,7 +7,7 @@ part of 'generic_website.dart';
// **************************************************************************
String _$genericWebsiteServiceHash() =>
r'bb36adc96b55531772554e79e4f72a6f5b038c52';
r'6b9f74e6009c04c962273631cee0b1a595c4fa61';
/// See also [GenericWebsiteService].
@ProviderFor(GenericWebsiteService)