xmlhttprequest.getResponseHeader throws exception if header doesn't exist

VERIFIED DUPLICATE of bug 276705

Status

()

VERIFIED DUPLICATE of bug 276705
13 years ago
13 years ago

People

(Reporter: ppmm, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 (ax)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 (ax)

make an xmlhttprequest, and when the request is complete, requesting
non-existing response header will result in an exception in javascript console.

Reproducible: Always

Steps to Reproduce:
1. make an xmlhttprequest, send request
2. in onreadystatechange event handler, call
.getResponseHeader("some_non_existing_header")


Actual Results:  
javascript console shows an exception:

Error: [Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.getResponseHeader]"  nsresult:
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: **** :: anonymous
:: line 144"  data: no]
Source File: ****
Line: 144

Expected Results:  
the call returns null. IE returns an empty string in this case, but I feel
returning null makes more sense...

*** This bug has been marked as a duplicate of 276705 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.