is-antibot 0.0.3 → 0.0.4

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/package.json +1 -1
  2. package/src/index.js +7 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "is-antibot",
3
3
  "description": "Detect Captcha responses",
4
4
  "homepage": "https://github.com/kikobeats/is-antibot",
5
- "version": "0.0.3",
5
+ "version": "0.0.4",
6
6
  "author": {
7
7
  "name": "Kiko Beats",
8
8
  "email": "josefrancisco.verdu@gmail.com",
package/src/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  const { parseUrl } = require('@metascraper/helpers')
4
4
  const debug = require('debug-logfmt')('is-antibot')
5
5
 
6
- module.exports = ({ url, htmlDom, html, headers = {} } = {}) => {
6
+ module.exports = ({ url, htmlDom, headers = {} } = {}) => {
7
7
  // https://developers.cloudflare.com/cloudflare-challenges/challenge-types/challenge-pages/detect-response/
8
8
  if (headers['cf-mitigated'] === 'challenge') {
9
9
  debug({ provider: 'cloudflare' })
@@ -16,6 +16,12 @@ module.exports = ({ url, htmlDom, html, headers = {} } = {}) => {
16
16
  return true
17
17
  }
18
18
 
19
+ // https://techdocs.akamai.com/property-mgr/docs/return-cache-status
20
+ if (headers['akamai-cache-status']?.startsWith('Error')) {
21
+ debug({ provider: 'akamai' })
22
+ return true
23
+ }
24
+
19
25
  const parsedUrl = parseUrl(url)
20
26
 
21
27
  if (parsedUrl.domainWithoutSuffix === 'reddit') {