Function matchesAuthorizationScheme

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

    Parameters

    • scheme: string

      Name of the authorization scheme (case insensitive).

    • Optionalauthorization: string

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

    Returns boolean

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