about summary refs log tree commit diff
path: root/src/media/mod.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-01-01 23:17:56 +0300
committerVika <vika@fireburn.ru>2025-01-01 23:17:56 +0300
commitd10710326da703f69eaa06723dc66e330fd32745 (patch)
treee4a32c2a7f2e4a61d1f3f6237977de64e47470ae /src/media/mod.rs
parent675141379067858376698d5f75ab163977d33e3a (diff)
downloadkittybox-d10710326da703f69eaa06723dc66e330fd32745.tar.zst
axum: 0.7.9 → 0.8.1
Some breaking changes. For better or for worse. The optional extractor
breaking change is a double-edged sword, since not all extractors can
be used with `Option<T>` now, and you have to use
`Result<T, T::Rejection>` even when you want to ignore an error coming
from an extractor, such as `Query`.

However, this allows catching errors on authorization extractors even
in places where authorization is optional.

Change-Id: I35f809d3adf27dbef0e7ee93dc1a7af178b7d014
Diffstat (limited to 'src/media/mod.rs')
-rw-r--r--src/media/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/media/mod.rs b/src/media/mod.rs
index 3ed6810..199f05f 100644
--- a/src/media/mod.rs
+++ b/src/media/mod.rs
@@ -1,7 +1,8 @@
 use axum::{
-    extract::{multipart::Multipart, FromRef, Host, Path, State}, response::{IntoResponse, Response}
+    extract::{multipart::Multipart, FromRef, Path, State}, response::{IntoResponse, Response}
 };
 use axum_extra::headers::{ContentLength, HeaderMapExt, HeaderValue, IfNoneMatch};
+use axum_extra::extract::Host;
 use axum_extra::TypedHeader;
 use kittybox_util::micropub::{Error as MicropubError, ErrorKind as ErrorType};
 use kittybox_indieauth::Scope;
@@ -132,5 +133,5 @@ pub fn router<St, A, M>() -> axum::Router<St> where
 {
     axum::Router::new()
         .route("/", axum::routing::post(upload::<M, A>))
-        .route("/uploads/*file", axum::routing::get(serve::<M>))
+        .route("/uploads/{*file}", axum::routing::get(serve::<M>))
 }