Closed Bug 298550 Opened 21 years ago Closed 21 years ago

xmlhttprequest.getResponseHeader throws exception if header doesn't exist

Categories

(Core :: XML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 276705

People

(Reporter: ppmm, Unassigned)

Details

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
Closed: 21 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.