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) ETagopen in new window or HTTP-dateopen in new window is matched against the resource.

When If-Range header is an HTTP-dateopen in new window:

  1. (ignored¹) If the HTTP-date validator provided is not a strong validator in the sense defined by Section 8.8.2.2open in new window, the condition is false.
  2. If the HTTP-date validator provided exactly matches the Last-Modified date of the resource, the condition is true.
  3. Otherwise, the condition is false.

When If-Range header is an ETagopen in new window:

  1. If the Etag validator provided exactly matches the ETag of the resource using the strong comparison, the condition is true.
  2. 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.

References