It appears to me that the success() function in Ajax.Request is broken. The current (trunk) version looks like this:
success: function() {
var status = this.getStatus();
return !status || (status >= 200 && status < 300);
},
So if the status is undefined or 0 success() returns true, which doesn't sound right to me.
I'm thinking it should be something like:
success: function() {
var status = this.getStatus();
return status && (status >= 200 && status < 300);
}
I haven't tested this change on the edge, but I have made the change on 1.5.1 and it works. The 1.5.1 function looks like this.
success: function() {
return this.transport.status
&& (this.transport.status >= 200 && this.transport.status < 300);
},
This all came up because according to http://www.w3.org/TR/2006/WD-XMLHttpRequest-20060405/#xmlhttprequest, Opera appears to be in violation of the XMLHttpRequest spec, specifically:
"If the status attribute is not available it MUST raise an exception. It MUST
be available when readyState is 3 (Receiving) or 4 (Loaded). When available, it
MUST represent the HTTP status code (typically 200 for a successful
connection)."
I was getting the case (in Opera) where readyState = 4 and status = 0. Clearly this is wrong, but in any case prototype was returning true for success() when clearly the ajax request was not successful. The actual return status was 504.