is-antibot 1.6.1 → 1.6.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.
- package/package.json +1 -1
- package/src/index.js +7 -6
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "is-antibot",
|
|
3
3
|
"description": "Identify if a response is an antibot challenge from CloudFlare, Akamai, DataDome, Vercel, PerimeterX, Shape Security, and more, including CAPTCHA providers like reCAPTCHA and hCaptcha.",
|
|
4
4
|
"homepage": "https://github.com/microlinkhq/is-antibot",
|
|
5
|
-
"version": "1.6.
|
|
5
|
+
"version": "1.6.2",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./src/index.js"
|
|
8
8
|
},
|
package/src/index.js
CHANGED
|
@@ -385,12 +385,13 @@ const detect = ({ headers = {}, html = '', url = '', statusCode } = {}) => {
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
// Reddit: blocked requests are served as HTML challenge pages.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
388
|
+
if (parseUrl(url).domain === 'reddit.com') {
|
|
389
|
+
if (statusCode === 403) {
|
|
390
|
+
return byStatusCode('reddit')
|
|
391
|
+
}
|
|
392
|
+
if (hasAnyHtml([/blocked by network security\./i])) {
|
|
393
|
+
return byHtml('reddit')
|
|
394
|
+
}
|
|
394
395
|
}
|
|
395
396
|
|
|
396
397
|
// LinkedIn: status 999 is LinkedIn's dedicated bot-detection response
|