Skip to content

Instantly share code, notes, and snippets.

@rogeriochaves
Created May 8, 2015 17:08
Show Gist options
  • Save rogeriochaves/ad633f47dab497a84ad0 to your computer and use it in GitHub Desktop.
Save rogeriochaves/ad633f47dab497a84ad0 to your computer and use it in GitHub Desktop.
Make ajax request fail
(function (originalOpen) {
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
if (url.match(/limits/)) url = "REJECTED";
originalOpen.call(this, method, url, async, user, password);
};
})(XMLHttpRequest.prototype.open);
@rogeriochaves
Copy link
Author

@roberto REJECTED

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