[common] use 'cf-mitigated' header to detect challenges

pull/5071/merge
Mike Fährmann 2 weeks ago
parent 4b04ccb3a1
commit 0db3c11ab0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -196,6 +196,10 @@ class Extractor():
server = response.headers.get("Server")
if server and server.startswith("cloudflare") and \
code in (403, 503):
mitigated = response.headers.get("cf-mitigated")
if mitigated and mitigated.lower() == "challenge":
self.log.warning("Cloudflare challenge")
break
content = response.content
if b"_cf_chl_opt" in content or b"jschl-answer" in content:
self.log.warning("Cloudflare challenge")

Loading…
Cancel
Save