Skip to contents

Does a response carry a browser check instead of the resource?

Usage

is_challenge(headers)

Arguments

headers

The response headers, either as the raw header block (one string, lines separated by \r\n) or as a named list such as curl::parse_headers_list() makes of it.

Value

TRUE when the response is a browser check that a real browser would pass. Recognized today: Cloudflare's, by its cf-mitigated: challenge header.

See also

is_block() for the other refusal a browser gets past.

Examples

is_challenge("HTTP/2 403\r\ncf-mitigated: challenge\r\n\r\n")
#> [1] TRUE
is_challenge("HTTP/2 200\r\ncontent-type: application/zip\r\n\r\n")
#> [1] FALSE