4314xx
4xx — Client Error
Request Header Fields Too Large
The server is unwilling to process the request because its header fields are too large.
What it means
The HTTP 431 Request Header Fields Too Large response status code indicates that the server refuses to process the request because the request's HTTP headers are too long.
This is usually caused by an excessively large Cookie header.
How it works
- 1The client sends a request with an 8KB Cookie header (perhaps containing many JWTs or tracking IDs).
- 2The server's HTTP parser (like Node.js or Nginx) has a hardcoded limit of 4KB or 8KB for headers.
- 3The server drops the request and returns 431.
Why you're seeing this
- • Massive cookies.
- • Too many custom headers.
How to fix it
- • Users can clear their browser cookies for the site. Developers must fix the bug causing the cookie bloat.
Framework Implementations
Node.js
// Node has a default limit of 8KB (historically) or 16KB for headers. // Can be increased via CLI flag: node --max-http-header-size=32000 app.js
Real-Life Scenarios
Automatically handled by web servers/proxies. Usually indicates a bug in the client application (like a cookie loop).
Cookie Bloat
A marketing script writes a new cookie on every page load. Over a year, the user accumulates 100 cookies. The browser sends all 100 on every request, exceeding the server's limit and crashing the site for that user with a 431.
HTTP Transaction
1. Client Request
GET / HTTP/1.1 Cookie: session=123; tracking=...[8000 chars]...
2. Server Response
HTTP/1.1 431 Request Header Fields Too Large
SEO Implications
None.