The user id to authenticate as; must contain no colon, which delimits the two credentials
The password to authenticate with
A Middleware wrapping a Fetch implementation with one authenticating every request as usr
RangeError If usr contains a colon
Creates a middleware authenticating requests with the
Basicscheme.Decorates a Fetch implementation with one adding an
Authorizationheader carrying the given credentials to every request, alongside the headers supplied by the caller; credentials already carried by the request are replaced, so the middleware is best applied to a client dedicated to a single origin.Requests are normalised as
Requestobjects before the header is attached, preserving the headers and the options carried by aRequestinput alongside the overrides supplied throughinit.Credentials are joined as
usr:pwd, normalised to Unicode NFC, and encoded as UTF-8 base64 once when the middleware is created, leaving nothing to compute on the request path.Base64 is not encryption:
Basiccredentials travel in a form any observer of the exchange may decode. Confine them tohttpsexchanges, as RFC 7617 § 4 requires.