about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-08-11 14:05:15 +0200
committerbptato <nincsnevem662@gmail.com>2024-08-11 14:05:15 +0200
commita0c6f80f76d60bc2bb36942d4162b90e6b5aa2a2 (patch)
treedbf93dc3b168c4a9e135f0fa4e1300892645ba68 /src/utils
parentd0910f85adfec4a2cddfe2297be821841f4dd671 (diff)
downloadchawan-a0c6f80f76d60bc2bb36942d4162b90e6b5aa2a2.tar.gz
dom: remove generic JS bindings
Dispatch manually with fromJS instead.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mimeguess.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/utils/mimeguess.nim b/src/utils/mimeguess.nim
index f13eaf89..d6224303 100644
--- a/src/utils/mimeguess.nim
+++ b/src/utils/mimeguess.nim
@@ -19,8 +19,7 @@ func guessContentType*(mimeTypes: MimeTypes; path: string;
       break
   if n > 0:
     let ext = path.substr(n + 1)
-    if ext in mimeTypes:
-      return mimeTypes[ext]
+    return mimeTypes.getOrDefault(ext, fallback)
   return fallback
 
 const JavaScriptTypes = [