Merge pull request #12220 from bevanjkay/cloudflare-regex-extend

audit: extend cloudflare https audit exception regex
This commit is contained in:
Mike McQuaid 2021-10-11 12:34:03 +01:00 committed by GitHub
commit cfb896a813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,7 @@ module Utils
# Check if a URL is protected by CloudFlare (e.g. badlion.net and jaxx.io). # Check if a URL is protected by CloudFlare (e.g. badlion.net and jaxx.io).
def url_protected_by_cloudflare?(details) def url_protected_by_cloudflare?(details)
[403, 503].include?(details[:status].to_i) && [403, 503].include?(details[:status].to_i) &&
details[:headers].match?(/^Set-Cookie: __cfduid=/i) && details[:headers].match?(/^Set-Cookie: (__cfduid|__cf_bm)=/i) &&
details[:headers].match?(/^Server: cloudflare/i) details[:headers].match?(/^Server: cloudflare/i)
end end