The
Range
header is a
CORS-safelisted request header
when the value is a single byte range.
This means that it can be used in cross-origin requests without triggering a
preflight
request, which is useful for requesting media and resuming downloads.
The following example requests the first 500 bytes of a resource:
To request the second 500 bytes:
Omitting the end position requests all remaining units of the resource, so the last 100 bytes of a resource with a length of 1000 bytes can be requested using:
Alternatively, if it's unknown how large a resource is, the last
n
bytes can be requested using a suffix range of
-n
: