From 98ab7ab9e8bd155ead2cfd0f52b9ea4b3e8eb7d8 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Thu, 24 Jun 2021 10:39:12 -0400 Subject: [PATCH] Blackhole non-token routes --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 29d5ea0..108e113 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use std::time::Duration; use actix_web::rt::{spawn, time, System}; use actix_web::web::{self, Data}; -use actix_web::{App, HttpServer}; +use actix_web::{App, HttpResponse, HttpServer}; use cache::{Cache, DiskCache}; use clap::Clap; use config::CliArgs; @@ -194,6 +194,14 @@ async fn main() -> Result<(), Box> { .service(routes::token_data) .service(routes::token_data_saver) .service(routes::metrics) + .route( + "/data/{tail:.*}", + web::get().to(HttpResponse::UnavailableForLegalReasons), + ) + .route( + "/data-saver/{tail:.*}", + web::get().to(HttpResponse::UnavailableForLegalReasons), + ) .route("{tail:.*}", web::get().to(routes::default)) .app_data(Data::from(Arc::clone(&data_1))) .app_data(Data::from(Arc::clone(&cache_0)))