diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-22 22:12:56 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-22 22:24:41 -0400 |
| commit | 214a9e6c1fd729fc2c49eb2a5d41b5651ff5bc61 (patch) | |
| tree | 2b687e9a3a98645e7d824c19079ecf158bb6c7b7 /src/ui/routes | |
| parent | 056e56ba2da03636eafba384322e386259817d41 (diff) | |
Set `charset` params on returned content types.
This is a somewhat indirect change; it removes `mime_guess` in favour of some very, uh, "bespoke" mime detection logic that hardcodes mime types for the small repertoire of file extensions actually present in the UI. `mime_guess` doesn't provide a way to set params as it exports its own `Mime` struct, which doesn't provide `with_params()`.
Diffstat (limited to 'src/ui/routes')
| -rw-r--r-- | src/ui/routes/path.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ui/routes/path.rs b/src/ui/routes/path.rs index 2e9a657..a387552 100644 --- a/src/ui/routes/path.rs +++ b/src/ui/routes/path.rs @@ -1,12 +1,9 @@ pub mod get { use axum::extract::Path; - use crate::ui::{ - assets::{Asset, Assets}, - error::NotFound, - }; + use crate::ui::assets::{Asset, Assets, Error}; - pub async fn handler(Path(path): Path<String>) -> Result<Asset, NotFound<String>> { + pub async fn handler(Path(path): Path<String>) -> Result<Asset, Error> { Assets::load(path) } } |
