diff --git a/src/fastboot-headers.js b/src/fastboot-headers.js index 450adc177..6f440a750 100644 --- a/src/fastboot-headers.js +++ b/src/fastboot-headers.js @@ -17,7 +17,7 @@ class FastBootHeaders { value = [value]; } - this.headers[header] = value; + this.headers[header.toLowerCase()] = value; } } diff --git a/test/fastboot-headers-test.js b/test/fastboot-headers-test.js index 3a0399efe..065ad0394 100644 --- a/test/fastboot-headers-test.js +++ b/test/fastboot-headers-test.js @@ -6,6 +6,15 @@ var FastBootHeaders = require('./../src/fastboot-headers.js'); var Ember = require('ember-source/dist'); describe('FastBootHeaders', function() { + it('lower normalizes the headers to lowercase', function() { + var headers = { + 'X-Test-Header': 'value1, value2' + }; + headers = new FastBootHeaders(headers); + + expect(headers.getAll('x-test-header')).to.deep.equal(['value1, value2']); + }); + it('returns an array from getAll when header value is string', function() { var headers = { 'x-test-header': 'value1, value2'