Share

YUI Library

Tracker: Bugs

5 [#1984672] responseText set null w/IE on HTTP error response - ID: 1954805
Last Update: Settings changed ( gpuckett )

When using the following kind of code:

YAHOO.util.Connect.setForm(uploadform, true);
YAHOO.util.Connect.asyncRequest('POST', url, uploadElt);

If the server returns a response with an error code in the 4xx range with a
response body, this body will not be taken into account by IE (7 and 6 as
far as I could tell) and will not be set into the IFrame created
dynamically by YUI. Therefore the following statement in uploadFile in
connection.js:

obj.responseText =
io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:nul
l;

Will set obj.responseText to null because IE seems to believe that the
response body should be discarded since it was an error (sigh).

Note that it doesn't change anything whether or not the content-type of the
response is text/html or text/plain

Note also that the code works fine if the response is using a status code
like 200.

Eventually I think it's a bug in IE but since it is triggered in YUI I
report it here.


Sylvain ( seel20 ) - 2008-04-30 13:36

5

Closed

Wont Fix

george puckett

Connection

2.2.2

Public


Comments ( 6 )

Date: 2009-01-24 08:01
Sender: gpuckettProject Admin

The YUI project has been migrated from Source Forge to YUILibrary.com.
This ticket has been moved to the tracker on YUILibrary.com that
corresponds to the project it was filed against (YUI2, YUI3, Compressor,
etc.). All tickets not yet closed on Source Forge have been transferred
with their current state intact. The Source Forge instance of all tickets
is being marked as closed to avoid confusion. You can track the
status/progress of this ticket at http://yuilibrary.com/ using the same
ticket ID as it held in Source Forge.


Date: 2008-09-05 19:27
Sender: tshaProject Admin


Root cause: IE will default to its own custom error page if the server
response is under 512 bytes. This will render the iframe document
unreadable.


Date: 2008-08-14 23:24
Sender: tshaProject Admin


Closing as "known issue". Let's see if we can get this on MSFT's radar.
If we can streamline a more coherent workaround (i.e., default to Failure),
we'll reopen this issue and provide a fix.


Date: 2008-06-12 08:44
Sender: seel20


It'd be interesting to report this limitation to Microsoft. I assume an
easier workaround for now would be to use the new YUI Uploader component.


Date: 2008-06-09 06:55
Sender: gpuckettProject Admin


This bug has been reviewed by the component owner who has provided the
following feedback:

I've tested this, and the document body is unreadable if the response is a
failure case. There is no other way to get at the response data. The only
resolution may be to document it as a known issue.



Date: 2008-04-30 23:37
Sender: gpuckettProject Admin


This bug report is being forwarded to the author or current owner of the
affected component for additional investigation and response.


Attached File

No Files Currently Attached

Changes ( 11 )

Field Old Value Date By
allow_comments 1 2009-01-24 08:01 gpuckett
assigned_to tsha 2009-01-24 08:01 gpuckett
status_id Open 2008-08-14 23:24 tsha
close_date - 2008-08-14 23:24 tsha
status_id Pending 2008-06-12 08:44 seel20
close_date 2008-06-09 06:55 2008-06-12 08:44 seel20
close_date - 2008-06-09 06:55 gpuckett
resolution_id None 2008-06-09 06:55 gpuckett
status_id Open 2008-06-09 06:55 gpuckett
summary responseText set to null with IE on HTTP error response 2008-06-06 21:51 gpuckett
assigned_to nobody 2008-04-30 23:37 gpuckett