Fix stable build
This commit is contained in:
parent
85cbb1d6d8
commit
89e7719939
|
@ -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")]
|
#[cfg(feature="serve_dir")]
|
||||||
use tokio::fs::File;
|
use tokio::fs::File;
|
||||||
|
|
||||||
|
@ -13,6 +15,7 @@ pub enum Body {
|
||||||
|
|
||||||
impl Body {
|
impl Body {
|
||||||
/// Called by [`Response::rewrite_all`]
|
/// 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> {
|
pub (crate) async fn rewrite_all(&mut self, based_on: &crate::Request) -> std::io::Result<bool> {
|
||||||
let bytes = match self {
|
let bytes = match self {
|
||||||
Self::Bytes(bytes) => {
|
Self::Bytes(bytes) => {
|
||||||
|
|
|
@ -59,6 +59,7 @@ impl Request {
|
||||||
.map(|hsh| {
|
.map(|hsh| {
|
||||||
ring::test::from_hex(hsh.as_str())
|
ring::test::from_hex(hsh.as_str())
|
||||||
.expect("Received invalid certificate fingerprint from upstream")
|
.expect("Received invalid certificate fingerprint from upstream")
|
||||||
|
.as_slice()
|
||||||
.try_into()
|
.try_into()
|
||||||
.expect("Received certificate fingerprint of invalid lenght from upstream")
|
.expect("Received certificate fingerprint of invalid lenght from upstream")
|
||||||
}),
|
}),
|
||||||
|
@ -239,7 +240,7 @@ impl Request {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
#[cfg(feature = "gemini_srv")] {
|
#[cfg(feature = "gemini_srv")] {
|
||||||
Some(path.to_string())
|
Some(path.as_ref().to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ impl Response {
|
||||||
self.status == 10
|
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
|
/// Rewrite any links in this response based on the path identified by a request
|
||||||
///
|
///
|
||||||
/// For more information about what rewriting a link means, see
|
/// For more information about what rewriting a link means, see
|
||||||
|
|
Loading…
Reference in New Issue