Skip to content
Myr

Merge pull request #1462 from gmethvin/colon_auth

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Allow colons in passwords for req.auth

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents 3ab3021, 17bf04d · Browse files · 2 files+33 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+33 added−2 removed

  • tests:+30 added−0 removed
  • other:+3 added−2 removed

2 files+33 added−2 removed

modified:lib/request.js+3 added-2 removed
391 unmodified lines
392 if (!parts[1]) return;393 auth = parts[1];394395 // credentials396 auth = new Buffer(auth, 'base64').toString().split(':');397 return { username: auth[0], password: auth[1] };396 auth = new Buffer(auth, 'base64').toString().match(/^([^:]*):(.*)$/);397 if (!auth) return;398 return { username: auth[1], password: auth[2] };399});400401/**402 * Return subdomains as an array.
85 unmodified lines
modified:test/req.auth.js+30 added