From ffd5fb12ccc7c8343d0d2550ba81190795e07227 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 18 Aug 2025 08:44:21 -0300 Subject: [PATCH] fix: initialize magic cookie with mime type and encoding flags Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) --- src/meta_plugin/magic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meta_plugin/magic.rs b/src/meta_plugin/magic.rs index 30984bd..ec46ebe 100644 --- a/src/meta_plugin/magic.rs +++ b/src/meta_plugin/magic.rs @@ -104,8 +104,8 @@ impl MetaPlugin for MagicFileMetaPlugin { // Store raw pointer to connection - unsafe but necessary for this design self.conn = Some(conn as *const _ as *mut Connection); - // Initialize magic cookie - let cookie = Cookie::open(CookieFlags::empty()) + // Initialize magic cookie with flags for comprehensive detection + let cookie = Cookie::open(CookieFlags::MIME_TYPE | CookieFlags::MIME_ENCODING) .map_err(|e| anyhow::anyhow!("Failed to open magic cookie: {}", e))?; cookie.load(&[] as &[&str]) .map_err(|e| anyhow::anyhow!("Failed to load magic database: {}", e))?;