HTTP 416 Range Not Satisfiable vs 431 Request Header Fields Too Large
Both HTTP 416 (Range Not Satisfiable) and 431 (Request Header Fields Too Large) belong to the 4xx Client Error category. 416 indicates that the server cannot serve the requested byte range. The Range header value is outside the resource's size. Meanwhile, 431 means that the server refuses to process the request because an individual header field or all headers collectively are too large.
Description
The server cannot serve the requested byte range. The Range header value is outside the resource's size.
When You See It
When requesting a byte range beyond the file's actual size.
How to Fix
Check the Content-Range in the response for the actual file size and adjust your Range header.
Description
The server refuses to process the request because an individual header field or all headers collectively are too large.
When You See It
When cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
How to Fix
Reduce header sizes. Clear excessive cookies. Use shorter tokens.
Key Differences
HTTP 416: The server cannot serve the requested byte range. The Range header value is outside the resource's size.
HTTP 431: The server refuses to process the request because an individual header field or all headers collectively are too large.
You encounter 416 when when requesting a byte range beyond the file's actual size.
You encounter 431 when when cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
When to Use Which
For 416 (Range Not Satisfiable): Check the Content-Range in the response for the actual file size and adjust your Range header. For 431 (Request Header Fields Too Large): Reduce header sizes. Clear excessive cookies. Use shorter tokens.