mirror of
https://github.com/axios/axios.git
synced 2026-04-13 15:01:54 +08:00
22 lines
713 B
JavaScript
22 lines
713 B
JavaScript
var normalizeHeaderName = require('../../../lib/helpers/normalizeHeaderName');
|
|
|
|
describe('helpers::normalizeHeaderName', function () {
|
|
it('should normalize matching header name', function () {
|
|
var headers = {
|
|
'conTenT-Type': 'foo/bar',
|
|
};
|
|
normalizeHeaderName(headers, 'Content-Type');
|
|
expect(headers['Content-Type']).toBe('foo/bar');
|
|
expect(headers['conTenT-Type']).toBeUndefined();
|
|
});
|
|
|
|
it('should not change non-matching header name', function () {
|
|
var headers = {
|
|
'content-type': 'foo/bar',
|
|
};
|
|
normalizeHeaderName(headers, 'Content-Length');
|
|
expect(headers['content-type']).toBe('foo/bar');
|
|
expect(headers['Content-Length']).toBeUndefined();
|
|
});
|
|
});
|