Skip to main content

Bug Tracker

Side navigation

#8297 closed bug (fixed)

Opened February 16, 2011 09:55PM UTC

Closed February 17, 2011 04:03PM UTC

Last modified March 09, 2012 07:28AM UTC

jQuery 1.5 getResponseHeader IE

Reported by: wienks_19@hotmail.com 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.

Attachments (0)
Change History (2)

Changed February 17, 2011 01:04PM UTC by jitter comment:1

component: unfiledajax
milestone: 1.next1.5.1
owner: → jaubourg
priority: undecidedblocker
status: newassigned

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

Changed February 17, 2011 04:03PM UTC by jaubourg comment:2

resolution: → fixed
status: assignedclosed

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