Skip to content

fix: preserve query string and fragment in federation picture URLs - #566

Open
NateMoeller wants to merge 1 commit into
fedimint:masterfrom
NateMoeller:fix/nostr-picture-url-query
Open

fix: preserve query string and fragment in federation picture URLs#566
NateMoeller wants to merge 1 commit into
fedimint:masterfrom
NateMoeller:fix/nostr-picture-url-query

Conversation

@NateMoeller

Copy link
Copy Markdown
Contributor

Summary

  • parse_picture rendered the validated picture URL via SafeUrl's Display, which is meant for safe logging and drops the query string and fragment
  • CDN avatars using sizing params or a signed query (e.g. ?w=64&sig=...) resolved to the wrong image
  • Switch to without_auth().as_str(), which strips credentials while preserving the full URL

Fixes #553

Test plan

  • cargo test --lib nostr:: — all tests pass, including updated test_parse_picture_preserves_query_string
  • cargo build --lib — builds clean

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
NateMoeller force-pushed the fix/nostr-picture-url-query branch from 0ceb50d to 60f7462 Compare September 9, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Federation picture URLs lose their query string and fragment

2 participants