Fix incorrect MIME type for .js files loaded through CordovaResourceAPI.

This fixes devtools complaining about .js files being served as "text/plain"
when they have gone through remapUrl().
This commit is contained in:
Andrew Grieve 2013-12-23 15:04:54 -05:00
parent be2f7d7a8a
commit 7951eee8a3

View File

@ -188,6 +188,9 @@ public class CordovaResourceApi {
extension = extension.toLowerCase(Locale.getDefault());
if (extension.equals("3ga")) {
return "audio/3gpp";
} else if (extension.equals("js")) {
// Missing from the map :(.
return "text/javascript";
}
return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
}