aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 616a2e5..b30447e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,8 +32,13 @@ async fn resp(arc: Arc<Ctx>, req: Request<Body>) -> anyhow::Result<Response<Body
.status(err)
.body(format!("{} {}", err, text).into())?);
}
-
let x = req.uri().path();
+ if x == "/" {
+ return Ok(Response::builder()
+ .status(302)
+ .header("Location", "https://git.nea.moe/nea/discordavatarproxy")
+ .body(Body::empty())?);
+ }
let request = match x.strip_prefix("/avatar/") {
None => return make_err(404, "Not found"),
Some(request) => request,