Bug 5924

Summary: Zero-length responses to XMLHTTPRequest mishandled
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebKit Misc.Assignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Minor CC: mitch.gart, purestorm
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://nypop.com/~ap/webkit/getzero.html
Attachments:
Description Flags
proposed fix eric: review+

Description Alexey Proskuryakov 2005-12-03 06:44:03 PST
If the response to XMLHTTPRequest is zero-length, not all onreadystatechange events do fire, and the 
response headers aren't properly retrieved.

Steps to reproduce: access the bug URL.

In MSIE, the request goes through all states. Firefox skips Interactive. WebKit skips Interactive and Loaded.

Even in Completed state, WebKit doesn't provide the headers or the response status.
Comment 1 Alexey Proskuryakov 2005-12-22 01:56:08 PST
Created attachment 5217 [details]
proposed fix
Comment 2 Alexey Proskuryakov 2005-12-22 02:00:58 PST
Additional test case (sync loading): http://nypop.com/~ap/webkit/getzerosync.html
Comment 3 Eric Seidel (no email) 2005-12-22 07:15:19 PST
Comment on attachment 5217 [details]
proposed fix

This looks totally fine.  You're just changing slotFinished to match slotData's
behavior in the case that slotData was never called.  r=me
Comment 4 Alexey Proskuryakov 2005-12-28 10:12:14 PST
*** Bug 6271 has been marked as a duplicate of this bug. ***
Comment 5 Alexey Proskuryakov 2006-10-15 04:31:11 PDT
*** Bug 11207 has been marked as a duplicate of this bug. ***