guess mime type based on path
Try to determine the mime type of a file first based on its path, then based on its content.
The previous behavior (looking only at the file content) inferred a
mime type of text/xml for .svg files (instead of image/svg+xml)
which prevented them from being shown when embedded e.g. in a markdown
document.
3 files changed
+29
-9
ed41e552
→
23d608d4
modified radicle-httpd/Cargo.lock
@@ -1469,6 +1469,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -2019,6 +2029,7 @@ dependencies = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -2942,6 +2953,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-httpd/Cargo.toml
@@ -30,6 +30,7 @@ hyper = { version = "1.6.0", default-features = false }
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified radicle-httpd/src/raw.rs
@@ -74,7 +74,7 @@ async fn file_by_commit_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -173,22 +173,24 @@ async fn file_by_canonical_head_handler(
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|