diff options
author | nea <romangraef@gmail.com> | 2022-11-25 19:33:05 +0100 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-11-25 19:33:05 +0100 |
commit | 0ed508b4ae5ba79d12cff1314438e79f322df9de (patch) | |
tree | fa6b3e1be227704a058dade4929d1c38f6ce0914 | |
parent | df4fc6d8a5b8b2e5cc9b5bb83ccd12ea3717f354 (diff) | |
download | discordavatarproxy-0ed508b4ae5ba79d12cff1314438e79f322df9de.tar.gz discordavatarproxy-0ed508b4ae5ba79d12cff1314438e79f322df9de.tar.bz2 discordavatarproxy-0ed508b4ae5ba79d12cff1314438e79f322df9de.zip |
advertisment
-rw-r--r-- | src/main.rs | 7 |
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, |