diff --git a/core/http/src/handling/response/build_and_write.rs b/core/http/src/handling/response/build_and_write.rs index 1d9e162fbda2c2e2f3d2ec07a2e55d83aa641f7d..a8cdb09f24704d24a7a026a0c9ccf60b20257a04 100644 --- a/core/http/src/handling/response/build_and_write.rs +++ b/core/http/src/handling/response/build_and_write.rs @@ -1,6 +1,6 @@ use std::io::Result; -use tokio::{io::{AsyncWriteExt, AsyncRead, AsyncWrite}, net::TcpStream}; +use tokio::io::{AsyncWriteExt, AsyncRead, AsyncWrite}; use crate::handling::{methods::Method, request::Request, response::Status}; @@ -37,10 +37,4 @@ impl Response { stream.write_all(&resp).await?; Ok(()) } - - pub async fn write_unencrypted(self, mut stream: TcpStream) -> Result<()> { - let resp = self.build(None); - stream.write_all(&resp).await?; - Ok(()) - } } diff --git a/core/http/src/setup.rs b/core/http/src/setup.rs index f451ed4e8d0c82da01979d76d5c6298cd84935c7..9802f0edd3498c8a6ac71a53b5ba66ac29642afc 100644 --- a/core/http/src/setup.rs +++ b/core/http/src/setup.rs @@ -1,4 +1,4 @@ -use std::{thread::available_parallelism}; +use std::thread::available_parallelism; use tokio::{ net::TcpListener, @@ -6,12 +6,16 @@ use tokio::{ signal::unix::{signal, SignalKind, Signal}, }; +#[cfg(feature = "secure")] use tokio_native_tls::{native_tls::{Identity, self}, TlsAcceptor}; use crate::{ handlers::handler::handle_connection, - handling::{routes::{Route, Uri}, response::{Response, Status}}, + handling::routes::{Route, Uri}, }; +#[cfg(feature = "secure")] +use crate::handling::response::{Response, Status}; + #[derive(Clone)] /// Represnts a [MountPoint] that can be mounted in the config