@@ -274,11 +274,6 @@ async fn healthz(data: web::Data<AppState>) -> HttpResponse {
274
274
}
275
275
}
276
276
277
- async fn redirector ( ) -> HttpResponse {
278
- HttpResponse :: TemporaryRedirect ( ) . insert_header ( ( header:: LOCATION , "https://tracker.mywaifu.best" ) ) . finish ( )
279
- // HttpResponse::build(StatusCode::TEMPORARY_REDIRECT).append_header((header::LOCATION, "https://tracker.mywaifu.best")).finish()
280
- }
281
-
282
277
struct AppState {
283
278
redis_connection : redis:: aio:: MultiplexedConnection ,
284
279
}
@@ -303,7 +298,6 @@ fn init_tracer(args: &Args) -> Result<sdktrace::Tracer, TraceError> {
303
298
}
304
299
305
300
static HOMEPAGE : & ' static str = "https://tracker.mywaifu.best" ;
306
- const HEADER : ( header:: HeaderName , & ' static str ) = ( header:: LOCATION , HOMEPAGE ) ;
307
301
308
302
#[ actix_web:: main]
309
303
async fn main ( ) -> std:: io:: Result < ( ) > {
@@ -329,12 +323,6 @@ async fn main() -> std::io::Result<()> {
329
323
let port = args. port . unwrap_or_else ( || 6969 ) ;
330
324
let host = args. host . unwrap_or_else ( || "0.0.0.0" . to_string ( ) ) ;
331
325
332
- // let REDIRECT_RESPONSE = HttpResponse::build(StatusCode::TEMPORARY_REDIRECT).append_header((header::LOCATION, "https://tracker.mywaifu.best")).finish();
333
- // let REDIRECT_RESPONSE = HttpResponse::TemporaryRedirect().insert_header((header::LOCATION, "https://tracker.mywaifu.best"));
334
- // let leaked = Box::leak(*REDIRECT_RESPONSE);
335
-
336
- // let myr = Redirect::to(HOMEPAGE);
337
-
338
326
return HttpServer :: new ( move || {
339
327
App :: new ( )
340
328
. app_data ( data. clone ( ) )
@@ -369,12 +357,9 @@ async fn main() -> std::io::Result<()> {
369
357
} )
370
358
. service ( healthz)
371
359
. service ( announce)
372
- // .default_service(web::to(redirector))
373
360
. default_service ( web:: to ( || async {
374
361
Redirect :: to ( HOMEPAGE )
375
- // myr
376
362
} ) )
377
- // .default_service(web::to(redirector))
378
363
} )
379
364
. bind ( ( host, port) ) ?
380
365
. max_connection_rate ( 8192 )
0 commit comments