From fc8e2796ca90392472203c03d849086b4a1aabc8 Mon Sep 17 00:00:00 2001 From: leiserfg Date: Tue, 6 Oct 2020 22:06:21 +0200 Subject: [PATCH] Remove schema from x-scheme-handler/file files --- src/common/mime_types.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/mime_types.rs b/src/common/mime_types.rs index 62fcd26..4e5f7a8 100644 --- a/src/common/mime_types.rs +++ b/src/common/mime_types.rs @@ -29,6 +29,9 @@ impl TryFrom<&str> for MimeType { fn try_from(arg: &str) -> Result { if let Ok(url) = url::Url::parse(arg) { + if url.scheme() == "file" { + return Self::try_from(url.path()) + } Ok(Self( format!("x-scheme-handler/{}", url.scheme()) .parse::()