Skip to content

fix: exclude trailing quotes from URLs in error dialog#2273

Open
thebtf wants to merge 1 commit intolbjlaq:mainfrom
thebtf:fix/url-parsing
Open

fix: exclude trailing quotes from URLs in error dialog#2273
thebtf wants to merge 1 commit intolbjlaq:mainfrom
thebtf:fix/url-parsing

Conversation

@thebtf
Copy link
Copy Markdown

@thebtf thebtf commented Mar 6, 2026

Summary

  • Fix URL regex in renderMessageWithLinks that captured trailing ", ', }, ], > from JSON-embedded URLs
  • Google API 403 responses include appeal URLs wrapped in JSON (e.g. "appeal_url":"https://..."), and the old regex /(https?:\/\/[^\s]+)/g would include the trailing quote, producing invalid links

Changes

  • AccountErrorDialog.tsx: Changed regex to /(https?:\/\/[^\s"'}\]>]+)/g

Test plan

  • Trigger 403 with appeal URL → link in error dialog should be clickable without trailing "
  • Verify "Invalid Dynamic Link" error no longer occurs when clicking appeal link

The renderMessageWithLinks regex /(https?:\/\/[^\s]+)/g was capturing
trailing ", ', }, ], > characters from JSON-embedded URLs (e.g. Google
API appeal_url wrapped in JSON quotes), producing invalid links like
https://support.google.com/...?hl=en"

Changed to /(https?:\/\/[^\s"'}\]>]+)/g to stop at these delimiters.
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