[Webkit-unassigned] [Bug 10716] New: responseText is null if HTTP response is empty

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Sun Sep 3 14:31:30 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=10716

           Summary: responseText is null if HTTP response is empty
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh PowerPC
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: daniel at brightbyte.de


Disclaimer: I don't have Safari around to check for myself, so the below is
kind of second hand and the platform is a guess. Also, I originally reported
this as a comment to bug 10638, but was told to file it separately.

The Problem: apperently, responseText, status, statusText and maybe other
fields are null if the response from the server was empty. But empty content is
valid in HTTP - so responseText should be an empty string, and status and
statusText should represent what the server actually sent (200 OK, hopefully).

This bug hits safari users when using an extension i recently contributed to
wikipedia - see <http://bugzilla.wikimedia.org/show_bug.cgi?id=7219>. Note that
I will try to write a workaround, so it may not be possible to reproduce the
problem on wikipedia.

I have seen reports of the same problem showing up if the server responds with
"304 Not Modified" (see
<http://www.bitterpill.org/bp/2005-06/safari-xmlhttprequest-undefine.html>) -
please check this while you are at it. As per the w3c draft, 304s should be
handeled transparently by XMLHttpRequest (as 200 OK), unless If-Modified-Since
was sent explicitely using setRequestHeader, in which case the actual response
(with code 304) should be passed on the to JS code.

Generally, this appears to be needed as a test case:

if ( readyState == 4 )
  assert ( status != null && statusText != null && responseText != null );

Test this especially with an empty response, for "200 OK" and for "304 Not
Modified" (for both cases: explicite or implicite If-Modified-Since).


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list