From 32e7c38b5b3e563650e7d91a127bea826ccf20ec Mon Sep 17 00:00:00 2001 From: Stephen Rosenthal Date: Tue, 12 May 2026 16:05:41 -0400 Subject: [PATCH] fix(auth): declare UTF-8 on callback success/error pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The localhost callback response sent `Content-Type: text/html` with no charset, so browsers fell back to Latin-1 / Windows-1252 and rendered non-ASCII org names (ex: "Datadog γ‚ŒγŠ 🚲🌀️🌷 データドッグ") as mojibake. Add `; charset=utf-8` to the HTTP header and a `` to both success and error page `` blocks for defense in depth. --- src/auth/callback.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auth/callback.rs b/src/auth/callback.rs index 3eaa996..ada9784 100644 --- a/src/auth/callback.rs +++ b/src/auth/callback.rs @@ -187,7 +187,7 @@ async fn accept_loop( ) }; let response = format!( - "HTTP/1.1 {status}\r\nContent-Type: text/html\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", + "HTTP/1.1 {status}\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", body.len() ); let _ = stream.write_all(response.as_bytes()).await; @@ -242,7 +242,7 @@ fn success_page( format!( r#" -Pup - Authentication Successful +Pup - Authentication Successful