fix(auth): declare UTF-8 on callback success/error pages#499
Merged
platinummonkey merged 1 commit intoMay 12, 2026
Merged
Conversation
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 `<meta charset="utf-8">` to both success and error page `<head>` blocks for defense in depth.
platinummonkey
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Localhost callback page rendered non-ASCII org names as mojibake — a Japanese-named org like
Datadog れお 🚲🌤️🌷 データドッグshowed up asDatadog れ㊠🚲🌤ï¸ðŸŒ· データドッグ. Root cause: the HTTP response sentContent-Type: text/htmlwith no charset, so browsers fell back to Latin-1 / Windows-1252 and decoded the UTF-8 bytes one at a time.Changes
src/auth/callback.rs:190— add; charset=utf-8to theContent-Typeheader.src/auth/callback.rs:245,:275— add<meta charset="utf-8">to the success and error page<head>blocks (defense in depth, in case the file is ever saved/reopened without HTTP headers).Content-Lengthis unchanged —String::len()returns byte length, which is what the header wants for UTF-8.Follow-up to #480, which introduced the org name in the callback page.
Test plan
cargo test --bin pup auth::callback— 20/20 passcargo clippy --bin pup --all-targets -- -D warningscleancargo fmt --checkclean