mirror of
https://github.com/chmln/handlr.git
synced 2024-11-27 11:23:51 +01:00
Merge pull request #23 from leiserfg/handle-file-schema
Remove schema from x-scheme-handler/file files
This commit is contained in:
commit
ba3c87c305
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> {
|
fn try_from(arg: &str) -> Result<Self> {
|
||||||
if let Ok(url) = url::Url::parse(arg) {
|
if let Ok(url) = url::Url::parse(arg) {
|
||||||
|
if url.scheme() == "file" {
|
||||||
|
return Self::try_from(url.path())
|
||||||
|
}
|
||||||
Ok(Self(
|
Ok(Self(
|
||||||
format!("x-scheme-handler/{}", url.scheme())
|
format!("x-scheme-handler/{}", url.scheme())
|
||||||
.parse::<Mime>()
|
.parse::<Mime>()
|
||||||
|
|
Loading…
Reference in a new issue