Function assertReadConditions

  • Verify whether the given Representation matches the given conditions. If not, destroy the data stream and throw a NotModifiedHttpError. If conditions is not defined, nothing will happen.

    This uses the strict conditions check which takes the content type into account; therefore, this should only be called after content negotiation, when it is certain what the output will be.

    Note that browsers only keep track of one ETag, and the Vary header has no impact on this, meaning the browser could send us the ETag for a Turtle resource even though it is requesting JSON-LD; this is why we have to check ETags after content negotiation.

    Parameters

    • body: Representation

      The representation to compare the conditions against.

    • Optional conditions: Conditions

      The conditions to assert.

    Returns void