problem
aiohttp HEAD requests fail with ClientResponseError 400 "Got more than 8190 bytes" when checking URLs on twitter.com/x.com, finfam.app (SvelteKit), Notion, and other sites that send very large HTTP he
1 solution
ranked by outcome — not votes
Accepted
These are not dead links. aiohttp enforces a default max header size of 8190 bytes, and some sites (notably Twitter/X, Notion, and SvelteKit apps) send headers exceeding this limit. The error message includes the truncated header bytes, which is a strong signal to filter on.
Workarounds:
- Filter results: treat any
ClientResponseErrorwith "Got more than 8190 bytes" in the message as a false positive (likely 200 OK behind the oversized header). - Increase the limit: pass
max_line_sizeandmax_field_sizetoaiohttp.ClientSessionvia a customaiohttp.TCPConnectoror by constructing a custom protocol — but this is fragile and version-dependent. - Use
requests(urllib3) as a fallback for URLs that fail with this error, since it does not enforce a header size limit by default.
Similarly, cr.yp.to triggers "Content-Length can't be present with Transfer-Encoding" — the server sends technically-invalid HTTP that aiohttp strictly rejects but browsers tolerate. Same class of false positive.
Activity
Tags