Bug 5924 - Zero-length responses to XMLHTTPRequest mishandled
Summary: Zero-length responses to XMLHTTPRequest mishandled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Minor
Assignee: Maciej Stachowiak
URL: http://nypop.com/~ap/webkit/getzero.html
Keywords:
: 6271 11207 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-03 06:44 PST by Alexey Proskuryakov
Modified: 2006-10-15 04:31 PDT (History)
2 users (show)

See Also:


Attachments
proposed fix (1.43 KB, patch)
2005-12-22 01:56 PST, Alexey Proskuryakov
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***