Add well-known host-meta page
Dependencies
- [2]
WLWTNO4YCreate form to request game password change link - [3]
DNFB7TNIAdd new pages and links to slow games and reset game password - [*]
EVP2FSBHSplit index page - [*]
WVHXYKCVAdd postgresql pools - [*]
4MZ4VIR7Initial commit - [*]
HZDCKIXQUse constants for templates
Change contents
- file addition: well_known.rs[5.17]
use actix_web::{web, HttpResponse};use crate::WebData;pub async fn host_meta(data: web::Data<WebData<'_>>) -> HttpResponse {HttpResponse::Ok().insert_header(("Content-Type", "application/xrd+xml")).insert_header(("Date",chrono::Utc::now().format("%a, %d %b %Y %H:%M:%S GMT").to_string(),)).body(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="{}://{}/.well-known/webfinger?resource={{uri}}"/></XRD>"#, data.base_proto, data.base_domain))} - edit in src/pages/mod.rs at line 12
pub mod well_known; - edit in src/main.rs at line 21[8.1626][6.744]
use pages::well_known::host_meta; - edit in src/main.rs at line 176[8.2461][2.1998]
.route("/.well-known/host-meta", web::get().to(host_meta))