diff options
author | Andrei Fangli <andrei_fangli@outlook.com> | 2018-11-26 19:00:41 +0200 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-11-26 12:00:41 -0500 |
commit | e0d941156900a6bff7c098c8ea7290528e468cf8 (patch) | |
tree | 5f0deeaf8fd98971364f57f66bd603e21326748f /test/unit | |
parent | 3ac907864c4d36b4fcb58826d9cb0e4ed62334b2 (diff) | |
download | jquery-e0d941156900a6bff7c098c8ea7290528e468cf8.tar.gz jquery-e0d941156900a6bff7c098c8ea7290528e468cf8.zip |
Ajax: Fix getResponseHeader(key) for IE11
- getResponseHeader(key) combines all header values for the provided key into a
single result where values are concatenated by ', '. This does not happen for
IE11 since multiple values for the same header are returned on separate lines.
This makes the function only return the last value of the header for IE11.
- Updated ajax headers test to better cover Object.prototype collisions
Close gh-4173
Fixes gh-3403
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/ajax.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index b8b46e245..f9cd3668d 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -252,7 +252,7 @@ QUnit.module( "ajax", { } ); } ); - ajaxTest( "jQuery.ajax() - headers", 5, function( assert ) { + ajaxTest( "jQuery.ajax() - headers", 8, function( assert ) { return { setup: function() { jQuery( document ).ajaxSend( function( evt, xhr ) { @@ -293,6 +293,9 @@ QUnit.module( "ajax", { assert.strictEqual( emptyHeader, "", "Empty header received" ); } assert.strictEqual( xhr.getResponseHeader( "Sample-Header2" ), "Hello World 2", "Second sample header received" ); + assert.strictEqual( xhr.getResponseHeader( "List-Header" ), "Item 1, Item 2", "List header received" ); + assert.strictEqual( xhr.getResponseHeader( "constructor" ), "prototype collision (constructor)", "constructor header received" ); + assert.strictEqual( xhr.getResponseHeader( "__proto__" ), null, "Undefined __proto__ header not received" ); } }; } ); |