4xx

431 Request Header Fields Too Large

The server refuses the request because the headers are too large.

What is HTTP 431?

This status code indicates that the server is unwilling to process the request because one or more header fields, or the total header section, is too large. This can be caused by excessively large cookies, authorization tokens, or custom headers. The client should reduce the size of the request headers and retry. Servers set maximum header sizes to protect against denial-of-service attacks and memory exhaustion.

Defined in RFC 6585

Common Causes

  • Extremely large cookies that accumulated over time from multiple subdomains
  • An oversized Authorization or Bearer token in the request headers
  • Too many custom headers or a single header with an excessively long value
  • Cookie-based session storage growing beyond server header size limits

How to Fix

  • Clear your browser cookies for the affected domain and try again
  • Reduce the size of cookies by storing data server-side instead of in cookies
  • Check for overly large authorization tokens and consider using a more compact format
  • Increase the server's maximum header size limit if legitimate requests require large headers