mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 22:48:00 +02:00
fix: fall back to default branch when resolving relative image URLs
The Anonymize form's preview built the readme baseUrl as "https://github.com/<owner>/<repo>/raw/<source.branch>/". When the form rendered before the branch field had populated (initial load, or while waiting on getBranches), the URL became ".../raw//" and the browser collapsed the empty segment, fetching ".../raw/<file>" instead of ".../raw/<branch>/<file>". Relative <img src="./X"> references then 404'd against a path with no branch — exactly the "branch missing" pattern in #407. Fall back to details.defaultBranch (then "main") so the base URL is always well-formed. Fixes #407.
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user