Add robots.txt #9
This commit is contained in:
parent
6f3beb6368
commit
81a50a237d
1 changed files with 8 additions and 4 deletions
|
@ -19,7 +19,7 @@ struct SecurityTemplate {
|
|||
url: String,
|
||||
}
|
||||
|
||||
fn get_security(config: Config, addr: Option<SocketAddr>) -> std::string::String {
|
||||
fn get_security(config: Config, addr: Option<SocketAddr>) -> String {
|
||||
let data = SecurityTemplate {
|
||||
contact: config.mail.unwrap_or_default(),
|
||||
pref_lang: config.lang.unwrap_or_default(),
|
||||
|
@ -31,14 +31,18 @@ fn get_security(config: Config, addr: Option<SocketAddr>) -> std::string::String
|
|||
|
||||
#[get("/humans.txt")]
|
||||
pub async fn humans() -> impl Responder {
|
||||
// TODO
|
||||
// TODO, see https://humanstxt.org/humans.txt
|
||||
actix_web::web::Redirect::to("/")
|
||||
}
|
||||
|
||||
#[get("/robots.txt")]
|
||||
pub async fn robots() -> impl Responder {
|
||||
// TODO
|
||||
actix_web::web::Redirect::to("/")
|
||||
HttpResponse::Ok().body(get_robots())
|
||||
}
|
||||
|
||||
fn get_robots() -> String {
|
||||
// TODO, see https://www.robotstxt.org/orig.html
|
||||
"User-agent: * Allow: /".to_string()
|
||||
}
|
||||
|
||||
#[get("/sitemap.xml")]
|
||||
|
|
Loading…
Reference in a new issue