Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

DELETE ajax request fails on Safari (OS X & iOS) #2625

Closed
PanzerKunst opened this Issue Jul 3, 2014 · 1 comment

Comments

Projects
None yet
3 participants

Hi,

When doing the following DELETE request on the latest Safari browsers (OS X and iOS), the onFailure callback is executed:

new Request({
    urlEncoded: false,
    emulation: false, // Otherwise PUT and DELETE requests are sent as POST
    url: url,
    onSuccess: function (responseText, responseXML) {
        alert("AJAX success :)");
    },
    onFailure: function (xhr) {
        alert("AJAX fail :(");
    }.bind(this)
}).delete();

This happens because Mootools sets a Content-Type header to the XHR, and Safari refuses to send DELETE XHRs with a Content-Type.

To reproduce:

  1. Set up a server which listens to DELETE requests on url
  2. Set up a web page with the above Javascript code
  3. Execute the page in a browser other than Safari. Check that the server receives the request, and that the "AJAX success :)" popup is displayed
  4. Execute the page in Safari. Witness the failure

@arian arian added this to the 1.5.2 milestone Oct 31, 2014

Owner

ibolmo commented Jan 14, 2015

We've tried to replicate the issue, but we were unsuccessful. Please provide more detail.

@ibolmo ibolmo closed this Jan 14, 2015

@ibolmo ibolmo added the worksforme label Jan 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment