Make XHR work for file:// urls
The response status will be 0 instead of a HTTP status code for file urls, so we need to consider a status of 0 as success too.
This commit is contained in:
@@ -125,7 +125,8 @@ ol.source.CartoDB.prototype.initializeMap_ = function() {
|
||||
*/
|
||||
ol.source.CartoDB.prototype.handleInitResponse_ = function(paramHash, event) {
|
||||
var client = /** @type {XMLHttpRequest} */ (event.target);
|
||||
if (client.status >= 200 && client.status < 300) {
|
||||
// status will be 0 for file:// urls
|
||||
if (!client.status || client.status >= 200 && client.status < 300) {
|
||||
var response;
|
||||
try {
|
||||
response = /** @type {CartoDBLayerInfo} */(JSON.parse(client.responseText));
|
||||
|
||||
Reference in New Issue
Block a user