From f643496416c75ea468ffd866ccfee6436a3912f0 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 18 Nov 2020 12:18:24 -0500 Subject: various updates (#263) * various updates * fix glory shot * fix mi url for updating my blog * fix CI --- src/main.rs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 01333c9..0baaeef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,12 +26,15 @@ async fn main() -> Result<()> { tracing_subscriber::fmt::init(); log::info!("starting up commit {}", env!("GITHUB_SHA")); - let state = Arc::new(app::init( - std::env::var("CONFIG_FNAME") - .unwrap_or("./config.dhall".into()) - .as_str() - .into(), - ).await?); + let state = Arc::new( + app::init( + std::env::var("CONFIG_FNAME") + .unwrap_or("./config.dhall".into()) + .as_str() + .into(), + ) + .await?, + ); let healthcheck = warp::get().and(warp::path(".within").and(warp::path("health")).map(|| "OK")); @@ -144,6 +147,17 @@ async fn main() -> Result<()> { ) }) .map(|reply| warp::reply::with_header(reply, "X-Clacks-Overhead", "GNU Ashlynn")) + .map(|reply| { + warp::reply::with_header( + reply, + "Link", + format!( + r#"<{}>; rel="webmention""#, + std::env::var("WEBMENTION_URL") + .unwrap_or("https://mi.within.website/api/webmention/accept".to_string()) + ), + ) + }) .with(warp::log(APPLICATION_NAME)) .recover(handlers::rejection); -- cgit v1.2.3