diff --git a/src/main.rs b/src/main.rs index 3df57db..4c8cc79 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,8 @@ use { providers::{Env, Format as _, Toml}, Profile, }, - response::Responder, + http::uri::Origin, + response::{Redirect, Responder}, serde::Serialize, State, }, @@ -29,6 +30,8 @@ enum FileView { #[response(content_type = "application/octet-stream")] File(Vec), + + Redirect(Redirect), } #[derive(Serialize)] @@ -49,7 +52,11 @@ enum Error { } #[rocket::get("/")] -async fn index(path: PathBuf, state: &State) -> Result { +async fn index( + path: PathBuf, + uri: &Origin<'_>, + state: &State, +) -> Result { /* The way things work in S3, the following holds for us: - we need to use a slash as separator @@ -61,10 +68,17 @@ async fn index(path: PathBuf, state: &State) -> Result