The requested byte range is outside the file.
When to use it
A Range request past the end of the resource.
Common causes and fixes
The Range header asks for bytes the server doesn’t have, usually past the end of the file. The classic cause is resuming a download with curl -C - or wget -c when the local file is already complete, or the remote file has changed size. The server replies with Content-Range: bytes */size, so the client can learn the real length.
Fix it by deleting the partial file and starting over, or comparing sizes first. Video players hit 416 when a file is replaced mid-stream or a CDN cached an older, shorter version; purge the cache. Clients should send If-Range with the ETag, so a changed file returns 200 with the full content instead of 416. Servers may also ignore Range and answer 200.
Client error (4xx)
4xx codes are client errors: the request itself is wrong, unauthorised or points at something that isn’t there. Retrying the same request won’t help.
What it looks like
HTTP/1.1 416 Range Not SatisfiableHow to send it
| Node.js / Express | res.status(416).end() |
|---|---|
| Python / Flask | return '', 416 |
| nginx | return 416; |
How to check it
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/