-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Description
Description
jqXHR.getResponseHeader fails to combine multiple HTTP headers with the same name. Instead, it only returns the value of the last HTTP header. This clashes with the specification of XMLHttpRequest.getResponseHeader, which states: "If there are multiple response headers with the same name, then their values are returned as a single concatenated string, where each value is separated from the previous one by a pair of comma and space."
The issue seems to occur only on Internet Explorer (I encountered it on IE11); calling IE's own XMLHttpRequest.getRequestHeader implementation does return the correct result,
From what I can tell Firefox 50 already combined the two headers into one before calling the XMLHttpRequest completion callback, inadvertently allowing jQuery to return the correct result.
Tested in jQuery 3.1.1.
Link to test case
I have no test-environment that can easily set multiple headers with the same name, unfortunately.