about summary refs log tree commit diff
path: root/src/media
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-01 22:50:28 +0300
committerVika <vika@fireburn.ru>2024-08-02 16:13:39 +0300
commit2318a33f9b359ae27b52cd9a19db1f6782d8dae3 (patch)
tree5f4dc1ad73d5c4104679a1976781861ec23cb20e /src/media
parent61a6bf6b80aea18d8b7af159d504004a29e50576 (diff)
Upgrade dependencies and fix deprecated functionality
I think I managed to not lose any functionality from my dependencies.

sqlparser remains unupgraded, but that's mostly because it is only
used in one example and it's not worth it to upgrade right now.
Diffstat (limited to 'src/media')
-rw-r--r--src/media/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/media/mod.rs b/src/media/mod.rs
index 47f456a..7884ef8 100644
--- a/src/media/mod.rs
+++ b/src/media/mod.rs
@@ -1,6 +1,8 @@
 use axum::{
-    extract::{multipart::Multipart, FromRef, Host, Path, State}, headers::{HeaderMapExt, HeaderValue, IfNoneMatch}, response::{IntoResponse, Response}, TypedHeader
+    extract::{multipart::Multipart, FromRef, Host, Path, State}, response::{IntoResponse, Response}
 };
+use axum_extra::headers::{HeaderMapExt, HeaderValue, IfNoneMatch};
+use axum_extra::TypedHeader;
 use kittybox_util::error::{MicropubError, ErrorType};
 use kittybox_indieauth::Scope;
 use crate::indieauth::{backend::AuthBackend, User};
@@ -74,7 +76,7 @@ pub(crate) async fn serve<S: MediaStore>(
             tracing::debug!("Metadata: {:?}", metadata);
 
             let etag = if let Some(etag) = metadata.etag {
-                let etag = format!("\"{}\"", etag).parse::<axum::headers::ETag>().unwrap();
+                let etag = format!("\"{}\"", etag).parse::<axum_extra::headers::ETag>().unwrap();
 
                 if let Some(TypedHeader(if_none_match)) = if_none_match {
                     tracing::debug!("If-None-Match: {:?}", if_none_match);
@@ -110,7 +112,7 @@ pub(crate) async fn serve<S: MediaStore>(
                     headers.typed_insert(etag);
                 }
             }
-            r.body(axum::body::StreamBody::new(stream))
+            r.body(axum::body::Body::from_stream(stream))
                 .unwrap()
                 .into_response()
         },