Make it possible to test the federation locally

And explain how to do it in the README
This commit is contained in:
Bat
2018-05-02 13:47:46 +01:00
parent 5f43f783b6
commit ac1a111d7b
7 changed files with 46 additions and 10 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ use rocket::http::ContentType;
use rocket::response::Content;
use BASE_URL;
use activity_pub::ap_url;
use activity_pub::webfinger::Webfinger;
use db_conn::DbConn;
use models::blogs::Blog;
@@ -12,9 +13,9 @@ fn host_meta() -> String {
format!(r#"
<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml" template="https://{domain}/.well-known/webfinger?resource={{uri}}"/>
<Link rel="lrdd" type="application/xrd+xml" template="{url}"/>
</XRD>
"#, domain = BASE_URL.as_str())
"#, url = ap_url(format!("{domain}/.well-known/webfinger?resource={{uri}}", domain = BASE_URL.as_str())))
}
#[derive(FromForm)]