forked from jmug/stoatchat
chore(thanos): strip down codebase to just API routes
This commit is contained in:
@@ -3,8 +3,6 @@ use rocket::response::{self, Responder};
|
||||
use rocket::fs::NamedFile;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::database::Ref;
|
||||
|
||||
pub struct CachedFile(NamedFile);
|
||||
|
||||
pub static CACHE_CONTROL: &'static str = "public, max-age=31536000, immutable";
|
||||
@@ -18,8 +16,8 @@ impl<'r> Responder<'r, 'static> for CachedFile {
|
||||
}
|
||||
|
||||
#[get("/<target>/default_avatar")]
|
||||
pub async fn req(target: Ref) -> Option<CachedFile> {
|
||||
match target.id.chars().nth(25).unwrap() {
|
||||
pub async fn req(target: String) -> Option<CachedFile> {
|
||||
match target.chars().nth(25).unwrap() {
|
||||
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' => {
|
||||
NamedFile::open(Path::new("assets/user_red.png")).await.ok().map(|n| CachedFile(n))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user