fix: apply url.PathEscape to databaseId in ruleset view HTTP functions

Agent-Logs-Url: https://github.com/cli/cli/sessions/e09c6964-46ba-4baf-a486-f8dce8c7ac48

Co-authored-by: babakks <36728931+babakks@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-23 10:36:18 +00:00 committed by GitHub
parent 74054c0f71
commit 0c1c1bdab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,12 +11,12 @@ import (
)
func viewRepoRuleset(httpClient *http.Client, repo ghrepo.Interface, databaseId string) (*shared.RulesetREST, error) {
path := fmt.Sprintf("repos/%s/%s/rulesets/%s", repo.RepoOwner(), repo.RepoName(), databaseId)
path := fmt.Sprintf("repos/%s/%s/rulesets/%s", repo.RepoOwner(), repo.RepoName(), url.PathEscape(databaseId))
return viewRuleset(httpClient, repo.RepoHost(), path)
}
func viewOrgRuleset(httpClient *http.Client, orgLogin string, databaseId string, host string) (*shared.RulesetREST, error) {
path := fmt.Sprintf("orgs/%s/rulesets/%s", url.PathEscape(orgLogin), databaseId)
path := fmt.Sprintf("orgs/%s/rulesets/%s", url.PathEscape(orgLogin), url.PathEscape(databaseId))
return viewRuleset(httpClient, host, path)
}