progress / JSDO

Client side TypeScript library to access Progress® Data Object Services
Other
23 stars 27 forks source link

Updated encoding of an Authorization header for BASIC authentication #246

Closed joshualan closed 5 years ago

joshualan commented 5 years ago

So the way we encoded was with the base-64 package's encode(). This function did not properly encode special characters (pretty much non-ASCII stuff was bonked).

With node's August 2018 update, there is now an in-house way to encode stuff. We don't need the base-64 package now, which is good.

// from https://gist.github.com/brandonmwest/a2632d0a65088a20c00a auth = (Buffer.from(${username}:${password}).toString('base64')

So I removed the base-64 dependency and just used the build in Node toString('base-64') functionality instead.