Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for when Content-Length header not present

  • Loading branch information...
commit 78a2811ee9db28bd566427253c3e4fe8a9ac78b3 1 parent 3989227
@ingemaradahl ingemaradahl authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/ResourceDepot.js
View
5 src/ResourceDepot.js
@@ -463,10 +463,9 @@ function loadJSON(file, callback) {
if (request.status == 404)
console.log("ERROR: file '" + file + "' does not exist!");
else {
- var len = parseInt(request.getResponseHeader("Content-Length"));
- if (request.responseText.length !== len) {
+ var len = request.getResponseHeader("Content-Length");
+ if (len && request.responseText.length !== parseInt(len)) {
console.log(len, request.responseText.length);
- // TODO
alert("An error occured while downloading Emberwind, please clear your cache and try again.");
}
else {
Please sign in to comment.
Something went wrong with that request. Please try again.