Skip to content

fix: render same-origin gateway paths in token icons - #23

Merged
erubboli merged 1 commit into
mainfrom
fix/picker-icon-relative-paths
Oct 12, 2026
Merged

erubboli merged 1 commit into
mainfrom
fix/picker-icon-relative-paths

Conversation

@erubboli

Copy link
Copy Markdown
Member

Problem

Bridge token icons still rendered as letter avatars even though the ipfs proxy served every metadata document and logo (15/15 HTTP 200 in the browser network log). Root cause: the bridge-sdk metadata pipeline resolves icons to same-origin gateway paths (/ipfs/), but safeImageUri only accepted absolute https:, ipfs: or data:image/ URIs — a relative path made new URL() throw, the icon resolved to null, and the picker rendered its fallback without ever creating an img element.

Fix

  • safeImageUri now passes through same-origin paths that start with a single slash. Privacy posture unchanged: those URLs can only hit our own ipfs proxy, so no third-party fetch is possible. Protocol-relative and backslash forms stay rejected so a foreign host cannot be smuggled past the check.

Verification

  • New tests: same-origin paths pass, // and backslash forms rejected; full suite 846 green, typecheck and build clean.

@erubboli
erubboli merged commit 6e1b55d into main Oct 12, 2026
10 checks passed
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.

1 participant