lacewing - v2.0.1
    Preparing search index...

    Function parseBearer

    • Extract the bearer token from an Authorization header. Accepts a Headers object, anything with a .headers (e.g. Request), or the raw header value. Throws BEARER_PARSE_FAILED on anything that isn't exactly one well-formed Bearer <token>.

      Note: when multiple Authorization headers were sent, Headers joins them with ", " - which this parser rejects, by design.

      A shape this library does not accept - notably a Node/Express request, whose headers is a plain record - throws TypeError rather than the misleading "missing header" it used to report.

      Parameters

      Returns string