mirror of
https://github.com/chmln/handlr.git
synced 2024-11-14 21:49:27 +01:00
Remove schema from x-scheme-handler/file files
This commit is contained in:
parent
9fe6980f86
commit
fc8e2796ca
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,9 @@ impl TryFrom<&str> for MimeType {
|
|||
|
||||
fn try_from(arg: &str) -> Result<Self> {
|
||||
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::<Mime>()
|
||||
|
|
Loading…
Reference in a new issue