mirror of
https://github.com/0xMassi/webclaw.git
synced 2026-06-06 22:05:13 +02:00
fix(fetch): guard challenge detection before utf8 decoding
This commit is contained in:
parent
a611ae26f3
commit
3bcb288d13
1 changed files with 4 additions and 0 deletions
|
|
@ -783,6 +783,10 @@ fn is_pdf_content_type(headers: &http::HeaderMap) -> bool {
|
|||
|
||||
/// Detect if a response looks like a bot protection challenge page.
|
||||
fn is_challenge_response(response: &Response) -> bool {
|
||||
let body_len = response.body().len();
|
||||
if body_len > 15_000 || body_len == 0 {
|
||||
return false;
|
||||
}
|
||||
is_challenge_html(response.text().as_ref())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue