From 89e7719939db568101c2992f8ea8cfc2046c0bb5 Mon Sep 17 00:00:00 2001 From: Emii Tatsuo Date: Tue, 1 Dec 2020 23:32:03 -0500 Subject: [PATCH] Fix stable build --- src/types/body.rs | 5 ++++- src/types/request.rs | 3 ++- src/types/response.rs | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/types/body.rs b/src/types/body.rs index 9a94769..d9aeca3 100644 --- a/src/types/body.rs +++ b/src/types/body.rs @@ -1,4 +1,6 @@ -use tokio::io::{AsyncRead, AsyncReadExt}; +use tokio::io::AsyncRead; +#[cfg(feature="scgi_srv")] +use tokio::io::AsyncReadExt; #[cfg(feature="serve_dir")] use tokio::fs::File; @@ -13,6 +15,7 @@ pub enum Body { impl Body { /// Called by [`Response::rewrite_all`] + #[cfg(feature="scgi_srv")] pub (crate) async fn rewrite_all(&mut self, based_on: &crate::Request) -> std::io::Result { let bytes = match self { Self::Bytes(bytes) => { diff --git a/src/types/request.rs b/src/types/request.rs index ba7ec49..34fddf9 100644 --- a/src/types/request.rs +++ b/src/types/request.rs @@ -59,6 +59,7 @@ impl Request { .map(|hsh| { ring::test::from_hex(hsh.as_str()) .expect("Received invalid certificate fingerprint from upstream") + .as_slice() .try_into() .expect("Received certificate fingerprint of invalid lenght from upstream") }), @@ -239,7 +240,7 @@ impl Request { }) } #[cfg(feature = "gemini_srv")] { - Some(path.to_string()) + Some(path.as_ref().to_string()) } } } diff --git a/src/types/response.rs b/src/types/response.rs index 759ef39..f2f6ec2 100644 --- a/src/types/response.rs +++ b/src/types/response.rs @@ -145,6 +145,7 @@ impl Response { self.status == 10 } + #[cfg_attr(feature="gemini_srv",allow(unused_variables))] /// Rewrite any links in this response based on the path identified by a request /// /// For more information about what rewriting a link means, see