Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#165 closed bug (invalid)

Last-Modified and Firefox 1.0

Reported by: klaus.hartl@… Owned by:
Priority: undecided Milestone:
Component: ajax Version:
Keywords: John Cc: John
Blocked by: Blocking:

Description

If the response header "Last-Modified" is not available, the following code breaks Firefox 1.0:

var modRes = xml.getResponseHeader("Last-Modified");
if ( ifModified && modRes ) jQuery.lastModified[url] = modRes;

It throws the following exception:

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.getResponseHeader]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://192.168.1.199/js/jquery.js :: anonymous :: line 5029" data: no] Source File: http://192.168.1.199/js/jquery.js Line: 5029

Fixed this with an try/catch block:

var modRes;
try {
    modRes = xml.getResponseHeader("Last-Modified");    
} catch (e) {
    // do something or do nothing?
}
if ( ifModified && modRes ) jQuery.lastModified[url] = modRes;

Change History (5)

comment:1 Changed 11 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in SVN (swallowing the exception).

comment:2 Changed 11 years ago by anonymous

Component: ajax
Priority: blocker
Resolution: invalid
Status: reopenedclosed
Type: bug

SPAMPOLICE

comment:3 Changed 11 years ago by John

Cc: John added; "" removed
Component: ajax1
Keywords: John added; response header removed
Milestone: 1
Priority: blocker1
Summary: Unavailable response header breaks Firefox 1.0John
Type: bug1
Version: 1

comment:4 Changed 11 years ago by anonymous

Component: ajax
Priority: blocker
Resolution: invalid
Status: reopenedclosed
Type: bug

SPAMPOLICE

comment:5 Changed 11 years ago by john

Summary: JohnLast-Modified and Firefox 1.0
Note: See TracTickets for help on using tickets.