Closed Bug 276705 Opened 20 years ago Closed 20 years ago

XMLHttpRequest throws exception if header requested with getResponseHeader doesn't exist

Categories

(Core :: XML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: ch.ey, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

According to nsIXMLHttpRequest.idl and other descriptions, the return value is
"A string containing the text of the header specified. NULL if the response has
not yet been received or the header does not exist in the response."

But in reality (trunk 20041231) Mozilla throws an exception if the header is not
available: 0x80040111 NS_ERROR_NOT_AVAILABLE.
Is the bug in the code or in the documentation? I'd prefer getting null.
Attachment #172642 - Flags: superreview?(jst)
Attachment #172642 - Flags: review?(doronr)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 172642 [details] [diff] [review]
Make the code follow the api

reporter: did this regress or has it always been like that?

r=doron
Attachment #172642 - Flags: review?(doronr) → review+
(In reply to comment #2)
> reporter: did this regress or has it always been like that?

I just started using this interface, so I can't tell.
Comment on attachment 172642 [details] [diff] [review]
Make the code follow the api

sr=jst
Attachment #172642 - Flags: superreview?(jst) → superreview+
Assignee: xml → bzbarsky
Target Milestone: --- → mozilla1.8beta
Fixed.  Note that I changed to SetIsVoid(PR_TRUE), since this is not an
nsAString... I don't know how this managed to compile.  :(
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
*** Bug 298550 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: