You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
538 B
22 lines
538 B
2 years ago
|
var map = require('./map');
|
||
|
var capitalize = require('./capitalize');
|
||
|
exports = function(header) {
|
||
|
var ret = specialHeaders[header.toLowerCase()];
|
||
|
if (!ret) {
|
||
|
ret = map(header.split('-'), capitalize).join('-');
|
||
|
}
|
||
|
return ret;
|
||
|
};
|
||
|
var specialHeaders = {
|
||
|
'content-md5': 'Content-MD5',
|
||
|
dnt: 'DNT',
|
||
|
etag: 'ETag',
|
||
|
'last-event-id': 'Last-Event-ID',
|
||
|
tcn: 'TCN',
|
||
|
te: 'TE',
|
||
|
'www-authenticate': 'WWW-Authenticate',
|
||
|
'x-dnsprefetch-control': 'X-DNSPrefetch-Control'
|
||
|
};
|
||
|
|
||
|
module.exports = exports;
|