Skip to content

Commit e8e570d

Browse files
authored
Merge pull request #189 from ryanto/normalize-headers
Normalize headers to lower case
2 parents 5a42df5 + c79fb5c commit e8e570d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/fastboot-headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FastBootHeaders {
1717
value = [value];
1818
}
1919

20-
this.headers[header] = value;
20+
this.headers[header.toLowerCase()] = value;
2121
}
2222
}
2323

test/fastboot-headers-test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ var FastBootHeaders = require('./../src/fastboot-headers.js');
66
var Ember = require('ember-source/dist');
77

88
describe('FastBootHeaders', function() {
9+
it('lower normalizes the headers to lowercase', function() {
10+
var headers = {
11+
'X-Test-Header': 'value1, value2'
12+
};
13+
headers = new FastBootHeaders(headers);
14+
15+
expect(headers.getAll('x-test-header')).to.deep.equal(['value1, value2']);
16+
});
17+
918
it('returns an array from getAll when header value is string', function() {
1019
var headers = {
1120
'x-test-header': 'value1, value2'

0 commit comments

Comments
 (0)