Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
75
fork

Configure Feed

Select the types of activity you want to include in your feed.

maybe this works for port 80 refusal

phil 93a44561 5a7a0c32

+11 -4
+11 -4
slingshot/src/server.rs
··· 1466 1466 "0.0.0.0:80" 1467 1467 })); 1468 1468 1469 - let https_plz = "this service must be accessed with https (port 443)."; 1469 + #[poem::handler] 1470 + async fn https_plz() -> (poem::http::StatusCode, &'static str) { 1471 + ( 1472 + poem::http::StatusCode::MISDIRECTED_REQUEST, 1473 + "this service must be accessed with https (port 443).", 1474 + ) 1475 + } 1470 1476 1471 1477 let app = if let Some(redir) = acme_challenge_redirect { 1472 1478 use poem::web; ··· 1479 1485 1480 1486 RouteScheme::new().https(app).http( 1481 1487 Route::new() 1482 - .nest("/", make_sync(move |_| https_plz)) 1483 - .at("/.well-known/acme-challenge/:token", redirect), 1488 + .at("/.well-known/acme-challenge/:token", redirect) 1489 + .at("/*any", https_plz) 1490 + .at("/", https_plz), 1484 1491 ) 1485 1492 } else { 1486 1493 RouteScheme::new() 1487 1494 .https(app) 1488 - .http(Route::new().nest("/", make_sync(move |_| https_plz))) 1495 + .http(Route::new().at("/*any", https_plz).at("/", https_plz)) 1489 1496 }; 1490 1497 1491 1498 Ok((listener, app))