From 998ffd3e3ac85a38aec8fc15c7addd02fa1af9ae Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 6 Mar 2022 17:14:10 +0300 Subject: Restored most of the functionality (except onboarding and some queries) --- src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 93e4593..ffef443 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,23 +1,20 @@ -#[allow(unused_imports)] -use warp::Filter; +#![deny(unsafe_code)] +#![warn(clippy::todo)] pub mod metrics; /// Database abstraction layer for Kittybox, allowing the CMS to work with any kind of database. pub mod database; pub mod micropub; pub mod indieauth; -//pub mod frontend; +pub mod frontend; -/*use crate::indieauth::IndieAuthMiddleware; -use crate::micropub::CORSMiddleware;*/ - -pub mod rejections { +pub(crate) mod rejections { #[derive(Debug)] - pub struct UnacceptableContentType; + pub(crate) struct UnacceptableContentType; impl warp::reject::Reject for UnacceptableContentType {} #[derive(Debug)] - pub struct HostHeaderUnset; + pub(crate) struct HostHeaderUnset; impl warp::reject::Reject for HostHeaderUnset {} } @@ -49,6 +46,7 @@ pub mod util { // This is unneccesarily complicated because I want to reuse some http-types parsing // and http-types has constructor for Headers private so I need to construct // a mock Request to reason about headers... this is so dumb wtf + // so much for zero-cost abstractions, huh let bytes: &[u8] = accept.as_bytes(); let value = http_types::headers::HeaderValue::from_bytes(bytes.to_vec()).unwrap(); let values: http_types::headers::HeaderValues = vec![value].into(); -- cgit 1.4.1