Skip to content

Commit

Permalink
fix(custom-protocol): SVG mime type - close #168 (#169)
Browse files Browse the repository at this point in the history
* fix(custom-protocol): Fix SVG mimetype - close #168

* Add changes file

* Fix test
  • Loading branch information
lemarier authored Apr 20, 2021
1 parent b8823fe commit 890cfe5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/svg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": minor
---

Fix SVG render with the custom protocol.
4 changes: 2 additions & 2 deletions src/webview/mimetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl std::fmt::Display for MimeType {
MimeType::JSONLD => "application/ld+json",
MimeType::OCTETSTREAM => "application/octet-stream",
MimeType::RTF => "application/rtf",
MimeType::SVG => "image/svg",
MimeType::SVG => "image/svg+xml",
};
write!(f, "{}", mime)
}
Expand Down Expand Up @@ -114,7 +114,7 @@ mod tests {
assert_eq!(rtf, String::from("application/rtf"));

let svg: String = MimeType::parse_from_uri("https://example.com/picture.svg").to_string();
assert_eq!(svg, String::from("image/svg"));
assert_eq!(svg, String::from("image/svg+xml"));

let custom_scheme = MimeType::parse_from_uri("wry://tauri.studio").to_string();
assert_eq!(custom_scheme, String::from("text/html"));
Expand Down

0 comments on commit 890cfe5

Please sign in to comment.