Function matchesAuthorizationScheme

  • Checks if the value of an HTTP Authorization header matches a specific scheme (e.g. Basic, Bearer, etc).

    Returns

    True if the Authorization header uses the specified scheme, false otherwise.

    Parameters

    • scheme: string

      Name of the authorization scheme (case insensitive).

    • Optional authorization: string

      The value of the Authorization header (may be undefined).

    Returns boolean