From f602811a0347ee31cd7a5559ccf9222ef398b395 Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Wed, 4 Dec 2024 12:20:32 -0500 Subject: [PATCH] fix: allow `:`, `.` in SSDs in auth cookie --- kinode/src/http/server.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kinode/src/http/server.rs b/kinode/src/http/server.rs index cb69db55..80146dc4 100644 --- a/kinode/src/http/server.rs +++ b/kinode/src/http/server.rs @@ -376,10 +376,12 @@ async fn login_handler( let cookie = match info.subdomain.unwrap_or_default().as_str() { "" => format!("kinode-auth_{our}={token};"), subdomain => { - // enforce that subdomain string only contains a-z, 0-9, and - + // enforce that subdomain string only contains a-z, 0-9, ., :, and - let subdomain = subdomain .chars() - .filter(|c| c.is_ascii_alphanumeric() || c == &'-') + .filter(|c| { + c.is_ascii_alphanumeric() || c == &'-' || c == &':' || c == &'.' + }) .collect::(); format!("kinode-auth_{our}@{subdomain}={token};") }