1 | ;
|
2 |
|
3 | var re = /(\S+)\s+(\S+)/;
|
4 |
|
5 |
|
6 |
|
7 | function parseAuthHeader(hdrValue) {
|
8 | if (typeof hdrValue !== 'string') {
|
9 | return null;
|
10 | }
|
11 | var matches = hdrValue.match(re);
|
12 | return matches && { scheme: matches[1], value: matches[2] };
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 | module.exports = {
|
18 | parse: parseAuthHeader
|
19 | };
|