MCPcopy Index your code
hub / github.com/Unitech/pm2 / parseBasicAuth

Function parseBasicAuth

lib/API/Serve.js:451–463  ·  view source on GitHub ↗
(auth)

Source from the content-addressed store, hash-verified

449}
450
451function parseBasicAuth(auth) {
452 // auth is like `Basic Y2hhcmxlczoxMjM0NQ==`
453 var tmp = auth.split(' ');
454
455 var buf = Buffer.from(tmp[1], 'base64');
456 var plain = buf.toString();
457
458 var creds = plain.split(':');
459 return {
460 username: creds[0],
461 password: creds[1]
462 }
463}
464
465function sendBasicAuthResponse(response) {
466 response.writeHead(401, {

Callers 1

Serve.jsFile · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…