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.
Extract the bearer token from an
Authorizationheader. Accepts aHeadersobject, anything with a.headers(e.g.Request), or the raw header value. ThrowsBEARER_PARSE_FAILEDon anything that isn't exactly one well-formedBearer <token>.Note: when multiple
Authorizationheaders were sent,Headersjoins them with", "- which this parser rejects, by design.A shape this library does not accept - notably a Node/Express request, whose
headersis a plain record - throws TypeError rather than the misleading "missing header" it used to report.