From 10bd35e6b6d34d58b93700b498609926aa5d90ba Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 8 Nov 2026 03:38:48 +0100 Subject: web: link the GPL source from the play page; normalise gateway config The browser footer links the public repository. ZAGAN_WEB_ORIGIN is lowercased for origin matching, and the pinned fingerprint accepts the colon-separated form operators often copy. --- webd/src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'webd') diff --git a/webd/src/config.rs b/webd/src/config.rs index d3ada8f..44ce4ec 100644 --- a/webd/src/config.rs +++ b/webd/src/config.rs @@ -34,11 +34,14 @@ impl Config { if !origin.starts_with("http://") && !origin.starts_with("https://") { return Err("ZAGAN_WEB_ORIGIN must start with http:// or https://".to_string()); } - let origin = origin.trim_end_matches('/').to_string(); + let origin = origin.trim_end_matches('/').to_ascii_lowercase(); let upstream = value("ZAGAN_UPSTREAM", DEFAULT_UPSTREAM); let fingerprint = required("ZAGAN_UPSTREAM_FINGERPRINT")?; - let fingerprint = fingerprint.trim().to_ascii_lowercase(); + let fingerprint = fingerprint + .trim() + .replace([':', ' ', '-'], "") + .to_ascii_lowercase(); if fingerprint.len() != 64 || !fingerprint.bytes().all(|byte| byte.is_ascii_hexdigit()) { return Err( "ZAGAN_UPSTREAM_FINGERPRINT must be the 64-character SHA-256 of the upstream SPKI" -- cgit v1.2.3