This project is archived and is in readonly mode.

#633 ✓resolved
Juri Kuehn

IE Bug with 204 HTTP responses - workaround in mootools

Reported by Juri Kuehn | April 7th, 2009 @ 11:50 AM | in 2.0 (closed)

Internet Explorer (including the brand new shiny IE8 ....) got a bug, where 204 http responses are sometimes transformed to 1223.

This leads to the triggering of onFailure event instead of onSuccess when using the Mootools Request object.

YUI and jQuery implemented a workaround for this bug. Can this also be implemented in mootools?

See also: https://groups.google.com/group/... http://webbugtrack.blogspot.com/... or http://www.enhanceie.com/ie/bugs... (Bug IE0013)

Comments and changes to this ticket

  • Daniele C.

    Daniele C. April 9th, 2009 @ 09:01 AM

    mmm maybe you can change the isSuccess function of the Request Object:

    @@@javascript isSuccess: function(){

    return ((this.status >= 200) && (this.status < 300));
    
    

    }

    
    
    in this way:
    
    @@@javascript
    isSuccess: function(){
    	return ((this.status >= 200) && (this.status < 300)) || (Browser.Engine.trident && this.status == 1223);
    }
    
  • Valerio

    Valerio April 13th, 2009 @ 11:42 PM

    • State changed from “new” to “open”
    • Assigned user set to “Valerio”

    The correct way to implement your own isSuccess is by either .implement-ing it into the Request class or just pass it as an option.

    A fix is in the works, in the meantime you can just implement a custom isSuccess with the correct checks to this.status.

  • Juri Kuehn

    Juri Kuehn April 14th, 2009 @ 12:31 PM

    Great, thank you very much. The suggested snippet by Daniele is working correctly and is a good solution until next release.

  • Juri Kuehn

    Juri Kuehn May 18th, 2009 @ 08:25 PM

    What works better for us is to change in class Request:

    from:

    isSuccess: function(){

    return (((this.status >= 200) && (this.status < 300)));
    

    },

    to

    isSuccess: function(){

    if (this.status == 1223) this.status = 204; // ie fix, see https://mootools.lighthouseapp.com/projects/2706/tickets/633-ie-bug-with-204-http-responses-workaround-in-mootools
    return (((this.status >= 200) && (this.status < 300)));
    

    },

    ie accepts the change of the status. this way you dont need to intercept status 1223 in your code and can continue working with 204

  • Christoph Pojer

    Christoph Pojer September 5th, 2010 @ 02:27 AM

    • State changed from “open” to “resolved”
    • Milestone order changed from “0” to “0”

    Resolved in 1.3

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages