If-Range
Class: \Aedart\ETags\Preconditions\Rfc9110\IfRange
Applicable
When the request method is GET
, both Range
and If-Range
headers are present, and the resource supports range requests.
Condition
a) ETag or HTTP-date is matched against the resource.
When If-Range
header is an HTTP-date:
- (ignored¹)
If the HTTP-date validator provided is not a strong validator in the sense defined by Section 8.8.2.2, the condition is false. - If the HTTP-date validator provided exactly matches the Last-Modified date of the resource, the condition is true.
- Otherwise, the condition is false.
When If-Range
header is an ETag:
- If the Etag validator provided exactly matches the ETag of the resource using the strong comparison, the condition is true.
- Otherwise, the condition is false.
b) If the requested ranges are applicable (if they are valid) for the requested resource. Validation of ranges is performed via a RangeValidator
.
1: Default implementation is not able to reliably deduce whether validation of Last-Modified Date is strong or weak.If you have a well versed in RFC9110's definitions of strong and weak Date validators, and you have a good idea on how this can be safely implemented, feel free to submit a pull request!
When it passes
The processRange()
action method is invoked. Evaluator continues to extensions, when available. Otherwise, request processing continues.
When it fails
The ignoreRange()
action method is invoked. Evaluator continues to extensions, when available. Otherwise, request processing continues.