diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-01-25 02:29:37 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-01-25 02:29:37 +0000 |
commit | d1d90b576ddb6558859f13118915747468f4d48a (patch) | |
tree | 270c090bbdfba03e8cb4a9bfb7907082bccaf19e /spec/javascripts | |
parent | d55839120e92be48b30d248ce9d72a19be038c79 (diff) | |
parent | 14b1d69b150f4e241fb6a47009e2b00c9520a199 (diff) | |
download | gitlab-ce-d1d90b576ddb6558859f13118915747468f4d48a.tar.gz |
Merge branch 'normalize_frontend_headers' into 'master'
Create a util for normalizing headers on the frontend
See merge request !8750
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js.es6 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js.es6 b/spec/javascripts/lib/utils/common_utils_spec.js.es6 index 031f9ca03c9..1ce8f28e568 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js.es6 +++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6 @@ -52,5 +52,22 @@ expect(value).toBe(null); }); }); + + describe('gl.utils.normalizedHeaders', () => { + it('should upperCase all the header keys to keep them consistent', () => { + const apiHeaders = { + 'X-Something-Workhorse': { workhorse: 'ok' }, + 'x-something-nginx': { nginx: 'ok' }, + }; + + const normalized = gl.utils.normalizeHeaders(apiHeaders); + + const WORKHORSE = 'X-SOMETHING-WORKHORSE'; + const NGINX = 'X-SOMETHING-NGINX'; + + expect(normalized[WORKHORSE].workhorse).toBe('ok'); + expect(normalized[NGINX].nginx).toBe('ok'); + }); + }); }); })(); |