From b7fc6c850896f6d046a1a5803fae9a8b6dfb7fe3 Mon Sep 17 00:00:00 2001 From: "Satoh, Hiroh" Date: Tue, 15 Oct 2019 21:13:39 +0900 Subject: [PATCH] fix(android): return proper mimeType for .mjs files (#2017) --- .../src/main/java/com/getcapacitor/WebViewLocalServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java index ed495c8f8..4bf058549 100755 --- a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java +++ b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java @@ -326,7 +326,7 @@ private String getMimeType(String path, InputStream stream) { Log.d(LogUtils.getCoreTag(), "We shouldn't be here"); } if (mimeType == null) { - if (path.endsWith(".js")) { + if (path.endsWith(".js") || path.endsWith(".mjs")) { // Make sure JS files get the proper mimetype to support ES modules mimeType = "application/javascript"; } else if (path.endsWith(".wasm")) {