Remove no token paths
This commit is contained in:
parent
c828c76128
commit
2e02944958
5 changed files with 5 additions and 25 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1221,7 +1221,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "mangadex-home"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"actix-web",
|
||||
"base64 0.13.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "mangadex-home"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
license = "MIT OR Apache-2.0"
|
||||
authors = ["Edward Shen <code@eddie.sh>"]
|
||||
edition = "2018"
|
||||
|
|
|
@ -10,8 +10,7 @@ use std::time::Duration;
|
|||
use std::{num::ParseIntError, sync::atomic::Ordering};
|
||||
|
||||
use actix_web::rt::{spawn, time, System};
|
||||
use actix_web::web;
|
||||
use actix_web::web::Data;
|
||||
use actix_web::web::{self, Data};
|
||||
use actix_web::{App, HttpServer};
|
||||
use log::{error, warn, LevelFilter};
|
||||
use parking_lot::RwLock;
|
||||
|
@ -85,9 +84,7 @@ async fn main() -> Result<(), std::io::Error> {
|
|||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.service(routes::token_data)
|
||||
.service(routes::no_token_data)
|
||||
.service(routes::token_data_saver)
|
||||
.service(routes::no_token_data_saver)
|
||||
.route("{tail:.*}", web::get().to(routes::default))
|
||||
.app_data(Data::from(Arc::clone(&data_1)))
|
||||
})
|
||||
|
|
|
@ -55,6 +55,7 @@ pub struct Response {
|
|||
pub token_key: Option<String>,
|
||||
pub compromised: bool,
|
||||
pub paused: bool,
|
||||
#[serde(default)]
|
||||
pub force_tokens: bool,
|
||||
pub tls: Option<Tls>,
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ const SERVER_ID_STRING: &str = concat!(
|
|||
env!("CARGO_PKG_VERSION"),
|
||||
" (",
|
||||
client_api_version!(),
|
||||
")",
|
||||
") - Conforming to spec revision b82043289",
|
||||
);
|
||||
|
||||
enum ServerResponse {
|
||||
|
@ -74,24 +74,6 @@ async fn token_data_saver(
|
|||
fetch_image(state, chapter_hash, file_name, true).await
|
||||
}
|
||||
|
||||
#[get("/data/{chapter_hash}/{file_name}")]
|
||||
async fn no_token_data(
|
||||
state: Data<RwLockServerState>,
|
||||
path: Path<(String, String)>,
|
||||
) -> impl Responder {
|
||||
let (chapter_hash, file_name) = path.into_inner();
|
||||
fetch_image(state, chapter_hash, file_name, false).await
|
||||
}
|
||||
|
||||
#[get("/data-saver/{chapter_hash}/{file_name}")]
|
||||
async fn no_token_data_saver(
|
||||
state: Data<RwLockServerState>,
|
||||
path: Path<(String, String)>,
|
||||
) -> impl Responder {
|
||||
let (chapter_hash, file_name) = path.into_inner();
|
||||
fetch_image(state, chapter_hash, file_name, true).await
|
||||
}
|
||||
|
||||
pub async fn default(state: Data<RwLockServerState>, req: HttpRequest) -> impl Responder {
|
||||
let path = &format!(
|
||||
"{}{}",
|
||||
|
|
Loading…
Reference in a new issue