fix(desktop): only proxy relay-origin Blossom URLs in media rewriter#392
Merged
wesbillman merged 1 commit intomainfrom Apr 23, 2026
Merged
fix(desktop): only proxy relay-origin Blossom URLs in media rewriter#392wesbillman merged 1 commit intomainfrom
wesbillman merged 1 commit intomainfrom
Conversation
rewriteRelayUrl() was matching ANY Blossom-patterned URL regardless of domain, then proxying it through the Sprout relay. External Blossom avatar URLs (e.g. from nostr.build) got fetched from the wrong server, resulting in 404s and missing avatars on desktop while mobile loaded them fine. Now fetches and caches the relay origin via get_relay_http_url at module init. Only URLs matching the relay origin are proxied; external Blossom URLs pass through unchanged to WKWebView. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
rewriteRelayUrl()matched any Blossom-patterned URL regardless of domain, then proxied it through the Sprout relay. External Blossom avatar URLs (e.g. nostr.build) got fetched from the wrong server → 404 → missing avatars on desktop while mobile loaded them fine.get_relay_http_urlat module init. Only URLs matching the relay origin are proxied; external Blossom URLs pass through unchanged to WKWebView.Test plan
Notable review notes
Beth flagged two CHANGE items (not blockers):
cachedRelayOriginresolves — strictly better than old behavior (always 404), andget_relay_http_urlis a sync Rust call behind IPC so it resolves nearly instantlyget_relay_http_urlIPC fails — low risk since the command is a sync env-var read, and failure reverts to old behavior🤖 Generated with Claude Code