Closed oleg-the-dev closed 1 month ago
Brave is not following the RFCs. There is no Content-Length
response header when Accept-Encoding
is set to gzip
or br
. The browsers may be tolerant to this ill-formed response, but unfortunately, curl is not.
To bypass this, simply remove the Accept-Encoding
header.
r = requests.get("https://search.brave.com/search", params={"q": "cats"}, headers={"Accept-Encoding": ""}, impersonate="chrome120")
Related curl issue: https://github.com/curl/curl/issues/5200 and CF discussion: https://community.cloudflare.com/t/missing-content-length-in-http-headers-for-some-urls/571349
Describe the bug I'm trying to request Brave search, but it gives me Failed to perform, curl: (23) error whether i use sync or async.
To Reproduce
Versions