fix: initialize magic cookie with mime type and encoding flags
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -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))?;
|
||||
|
||||
Reference in New Issue
Block a user