toBase64 has broken Unicode fallback — will throw on non-ASCII content #15
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
blocked:verify-failed
bug
feature-request
quickfix
security/high
security/medium
test-coverage
triage-approved
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/GSD2_agent#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low (edge case)
File:
src/lib/git.tslines 17-24Issue: The
toBase64function:The fallback
btoa(str)will throw aInvalidCharacterErrorifstrcontains non-ASCII characters, becausebtoaonly works with Latin-1 characters. The fallback is essentially useless — it would throw for the same reason the try block failed (non-ASCII characters).This affects pushing files containing Unicode content to GitHub or Forgejo via the API.
Fix: The proper pattern is already in the try block (encodeURIComponent + unescape). The catch should not exist, or should use a TextEncoder approach.