Add url.PathEscape to remaining url.JoinPath call sites

Escape all dynamic path segments that were previously unescaped: GitHub
org and login, Sentry orgSlug, Cloudflare accountID, DocuSign accountID,
Microsoft 365 roleID, and Tally/Sentry/GitHub name resolvers.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-05-20 13:06:30 +04:00
parent f0fe70fe1c
commit 8ec07aa697
6 changed files with 11 additions and 11 deletions

View File

@@ -304,7 +304,7 @@ func NewTallyNameResolver(httpClient *http.Client, organizationID string) NameRe
}
func (r *tallyNameResolver) ResolveInstanceName(ctx context.Context) (string, error) {
endpoint, err := url.JoinPath("https://api.tally.so", "organizations", r.organizationID)
endpoint, err := url.JoinPath("https://api.tally.so", "organizations", url.PathEscape(r.organizationID))
if err != nil {
return "", fmt.Errorf("cannot build tally organization URL: %w", err)
}
@@ -491,7 +491,7 @@ func (r *sentryNameResolver) ResolveInstanceName(ctx context.Context) (string, e
return "", nil
}
endpoint, err := url.JoinPath("https://sentry.io", "api", "0", "organizations", r.orgSlug)
endpoint, err := url.JoinPath("https://sentry.io", "api", "0", "organizations", url.PathEscape(r.orgSlug))
if err != nil {
return "", fmt.Errorf("cannot build sentry organization URL: %w", err)
}
@@ -535,7 +535,7 @@ func NewGitHubNameResolver(httpClient *http.Client, org string) NameResolver {
}
func (r *githubNameResolver) ResolveInstanceName(ctx context.Context) (string, error) {
endpoint, err := url.JoinPath("https://api.github.com", "orgs", r.org)
endpoint, err := url.JoinPath("https://api.github.com", "orgs", url.PathEscape(r.org))
if err != nil {
return "", fmt.Errorf("cannot build github organization URL: %w", err)
}