metascraper-logo-favicon 5.32.0 → 5.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -110,8 +110,14 @@ const createGetLogo = ({ gotOpts, keyvOpts }) => {
110
110
  const faviconUrl = logo('/favicon.ico', { url })
111
111
  if (!faviconUrl) return
112
112
 
113
- let response = await reachableUrl(faviconUrl, gotOpts)
114
- if (reachableUrl.isReachable(response)) return faviconUrl
113
+ let response = await reachableUrl(faviconUrl, {
114
+ ...gotOpts,
115
+ followRedirect: false
116
+ })
117
+
118
+ if (response.statusCode >= 200 && response.statusCode < 300) {
119
+ return faviconUrl
120
+ }
115
121
 
116
122
  response = await reachableUrl(
117
123
  `https://www.google.com/s2/favicons?domain_url=${url}&sz=128`,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper-logo-favicon",
3
3
  "description": "metascraper logo favicon fallback",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-logo-favicon",
5
- "version": "5.32.0",
5
+ "version": "5.32.2",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@keyvhq/memoize": "~1.6.14",
27
- "@metascraper/helpers": "^5.31.3",
27
+ "@metascraper/helpers": "^5.32.1",
28
28
  "lodash": "~4.17.21",
29
29
  "reachable-url": "~1.7.0"
30
30
  },
@@ -41,5 +41,5 @@
41
41
  "test": "NODE_PATH=.. TZ=UTC ava --timeout 15s"
42
42
  },
43
43
  "license": "MIT",
44
- "gitHead": "c79648b670be7b426b8b409dca1ff703933d2f4f"
44
+ "gitHead": "0dfa9acc1cdcae0434456f11bfa7c229fc48d52c"
45
45
  }