
status code for a request showing 502 when connection failed
an XMLhttpRequest connection failed or blocked due to Cross-Origin Request Blocked: (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). the status code from request object is zero (0). when tried like this
XMLHttpRequest.prototype.open = (function(open) {
return function(method, url, async, user, password) { this.onload = function() { console.log(this.status); }; open.apply(this, arguments); };
})(XMLHttpRequest.prototype.open);
but how come in network tab its showing 502.
an XMLhttpRequest connection failed or blocked due to
Cross-Origin Request Blocked: (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
the status code from request object is zero (0). when tried like this
XMLHttpRequest.prototype.open = (function(open) {
return function(method, url, async, user, password) {
this.onload = function() {
console.log(this.status);
};
open.apply(this, arguments);
};
})(XMLHttpRequest.prototype.open);
but how come in network tab its showing 502.
Modificado por spunky838 a