diff options
author | jaubourg <j@ubourg.net> | 2011-02-17 17:03:09 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-02-17 17:03:09 +0100 |
commit | 5b38439011799ae53156d137305d9440e0cddb0a (patch) | |
tree | 1555f58d0384fc9c01692f4445e01fe668d3444b /src/ajax.js | |
parent | faa6fe32f72900d7b31000caead2794a8346f6d8 (diff) | |
download | jquery-5b38439011799ae53156d137305d9440e0cddb0a.tar.gz jquery-5b38439011799ae53156d137305d9440e0cddb0a.zip |
Fixes #8297. Makes sure response headers with empty values are handled properly and do not prevent proper parsing of the entire response headers string. Unit test amended.
Diffstat (limited to 'src/ajax.js')
-rw-r--r-- | src/ajax.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ajax.js b/src/ajax.js index 76a2dc812..6414e8c29 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -4,7 +4,7 @@ var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rhash = /#.*$/, - rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /(?:^file|^widget|\-extension):$/, @@ -439,7 +439,7 @@ jQuery.extend({ } match = responseHeaders[ key.toLowerCase() ]; } - return match || null; + return match === undefined ? null : match; }, // Overrides response content-type header |