URL-escape file paths and refs in Gitea client #7

Closed
opened 2026-05-01 19:23:37 +00:00 by rodin · 0 comments
Owner

Problem

GetFileContentRef and GetPullRequestFiles build URLs via fmt.Sprintf without escaping paths or refs. If paths contain special characters (#, ?, spaces), the URL breaks.

Fix

Use url.PathEscape for file paths and url.QueryEscape for ref params in all Gitea client methods that accept user-provided paths.

## Problem `GetFileContentRef` and `GetPullRequestFiles` build URLs via `fmt.Sprintf` without escaping paths or refs. If paths contain special characters (`#`, `?`, spaces), the URL breaks. ## Fix Use `url.PathEscape` for file paths and `url.QueryEscape` for ref params in all Gitea client methods that accept user-provided paths.
rodin referenced this issue from a commit 2026-05-01 21:19:38 +00:00
rodin closed this issue 2026-05-01 21:30:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#7