Class BasicConditionsParser

Creates a Conditions object based on the the following headers:

  • If-Modified-Since
  • If-Unmodified-Since
  • If-Match
  • If-None-Match

Implementation based on RFC7232

Hierarchy

Constructors

Properties

logger: Logger = ...

Methods

  • Checks if the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.

    Parameters

    • input: HttpRequest

      Input that could potentially be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.

  • Converts a request header containing a datetime string to an actual Date object. Undefined if there is no value for the given header name.

    Parameters

    • request: HttpRequest
    • header: "if-modified-since" | "if-unmodified-since"

    Returns undefined | Date

  • Converts a request header containing ETags to an array of ETags. Undefined if there is no value for the given header name.

    Parameters

    • request: HttpRequest
    • header: "if-match" | "if-none-match"

    Returns undefined | string[]