luci-base: luci.js: only use overrideMimeType when supported
authorJo-Philipp Wich <jo@mein.io>
Thu, 11 Jul 2019 13:06:13 +0000 (15:06 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 11 Jul 2019 13:06:13 +0000 (15:06 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

index 1f883ab80244c53f36b66b0e8ae6536f8f0f1db1..6659bc51b67b4428245ed449d7d876ad1e7e5b1c 100644 (file)
                                        opt.xhr.open(opt.method, opt.url, true);
 
                                opt.xhr.responseType = 'text';
-                               opt.xhr.overrideMimeType('application/octet-stream');
+
+                               if ('overrideMimeType' in opt.xhr)
+                                       opt.xhr.overrideMimeType('application/octet-stream');
 
                                if ('timeout' in opt)
                                        opt.xhr.timeout = +opt.timeout;