#8297 closed bug (fixed)
jQuery 1.5 getResponseHeader IE
| Reported by: | wienks_19@… | Owned by: | jaubourg |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.5.1 |
| Component: | ajax | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
With the new upgrade to 1.5, the XMLHttpRequest has been wrapped with a new JQuery object (jqXHR).
In IE (IE7 for sure) if a response header is returned with only a key, and no value, the new upgrade takes the next key/value pair and uses that for its value.
Example of a response header:
Key-1:
Key-2: Testing
Key-3: Testing 2
In IE7, if the we call the request header
var value1 = jqXHR.getResponseHeader("Key-1");
var value2 = jqXHR.getResponseHeader("Key-2");
var value3 = jqXHR.getResponseHeader("Key-3");
value1's value will actually be "Key-2: Testing". value2 will be empty or null. value3's value will be "Testing 2"
This is a fairly large defect.
Change History (2)
comment:1 Changed 5 years ago by jitter
- Component changed from unfiled to ajax
- Milestone changed from 1.next to 1.5.1
- Owner set to jaubourg
- Priority changed from undecided to blocker
- Status changed from new to assigned
comment:2 Changed 5 years ago by jaubourg
- Resolution set to fixed
- Status changed from assigned to closed
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.
Changeset: 5b38439011799ae53156d137305d9440e0cddb0a

Confirmed.
According to RFC2616 4.2 and RFC0822 3.2 empty headers are valid. This looks like a serious bug in the rheaders regex in ajax.js