From 112dabb4bcde7ead9ae707b2c22758600b97e4db Mon Sep 17 00:00:00 2001 From: cobafan Date: Thu, 1 Jun 2023 01:33:01 +0900 Subject: [PATCH 1/2] provide the user agent in the request header when getting request --- lib/src/metadata_fetch_base.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/metadata_fetch_base.dart b/lib/src/metadata_fetch_base.dart index 8ebc2cc..ab15557 100644 --- a/lib/src/metadata_fetch_base.dart +++ b/lib/src/metadata_fetch_base.dart @@ -20,7 +20,7 @@ class MetadataFetch { defaultOutput.description = url; // Make our network call - final response = await http.get(Uri.parse(url)); + final response = await http.get(Uri.parse(url), headers: {'User-Agent': 'Googlebot'}); final headerContentType = response.headers['content-type']; if (headerContentType != null && headerContentType.startsWith(r'image/')) { From 8fbfe20d34de74000c05601cd916c0983da180f5 Mon Sep 17 00:00:00 2001 From: cobafan Date: Sat, 19 Aug 2023 16:13:23 +0900 Subject: [PATCH 2/2] update dependency http --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a9c7c2a..24ac998 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: - http: ^0.13.3 + http: ^1.0.0 string_validator: ^0.3.0 html: ^0.15.0