Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/brainbrowser/lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@
// Based on jQuery's "success" codes.
if(status >= 200 && status < 300 || status === 304) {
if (!loader.checkCancel(options)) {
callback(request.response, filename, options);
var result = request.response;
try {
/* See if the data can be inflated.
*/
var unzipped = pako.inflate(result);
result = unzipped.buffer;
} catch(e) {
/* pako probably didn't recognize this as gzip.
*/
} finally {
callback(result, filename, options);
}
}
} else {
var error_message = "error loading URL: " + url + "\n" +
Expand Down