Permalink
Browse files

Only use the @2x image if its content-type is some type of image.

  • Loading branch information...
1 parent 604ce4a commit e19987c3bc6286755c0c3975df0e6453bb6686f0 @zackdever zackdever committed Aug 23, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/retina.js
View
@@ -31,6 +31,11 @@
}
if (http.status >= 200 && http.status <= 399) {
+ var type = http.getResponseHeader('Content-Type');
+ if (type == null || !type.match(/^image/i)) {
+ return callback(false);
+ }
+
RetinaImagePath.confirmed_paths.push(that.at_2x_path);
return callback(true);
} else {

0 comments on commit e19987c

Please sign in to comment.