fix: preserve query string and fragment in federation picture URLs - #566
Open
NateMoeller wants to merge 1 commit into
Open
fix: preserve query string and fragment in federation picture URLs#566NateMoeller wants to merge 1 commit into
NateMoeller wants to merge 1 commit into
Conversation
m1sterc001guy
approved these changes
Sep 7, 2026
parse_picture rendered the validated picture URL via SafeUrl's Display, which is meant for safe logging and drops query/fragment. CDN avatars using sizing params or a signed query resolved to the wrong image. Use without_auth() + as_str() instead, which strips credentials while keeping the full URL. Fixes fedimint#553
NateMoeller
force-pushed
the
fix/nostr-picture-url-query
branch
from
September 9, 2026 04:15
0ceb50d to
60f7462
Compare
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
parse_picturerendered the validated picture URL viaSafeUrl'sDisplay, which is meant for safe logging and drops the query string and fragment?w=64&sig=...) resolved to the wrong imagewithout_auth().as_str(), which strips credentials while preserving the full URLFixes #553
Test plan
cargo test --lib nostr::— all tests pass, including updatedtest_parse_picture_preserves_query_stringcargo build --lib— builds clean