Fix stable build

This commit is contained in:
Emii Tatsuo 2020-12-01 23:32:03 -05:00
parent 85cbb1d6d8
commit 89e7719939
Signed by: Emi
GPG Key ID: 68FAB2E2E6DFC98B
3 changed files with 7 additions and 2 deletions

View File

@ -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<bool> {
let bytes = match self {
Self::Bytes(bytes) => {

View File

@ -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())
}
}
}

View File

@ -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