URL-escape file paths and refs in Gitea client #7
Reference in New Issue
Block a user
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?
Problem
GetFileContentRefandGetPullRequestFilesbuild URLs viafmt.Sprintfwithout escaping paths or refs. If paths contain special characters (#,?, spaces), the URL breaks.Fix
Use
url.PathEscapefor file paths andurl.QueryEscapefor ref params in all Gitea client methods that accept user-provided paths.