Skip to content

refactor(api): rename GetURIStringPointer to ResolveRequestURI, reject absolute relativePath - #9043

Merged
Startrekzky merged 2 commits into
mainfrom
kw-ensure-relpath
Aug 11, 2026
Merged

refactor(api): rename GetURIStringPointer to ResolveRequestURI, reject absolute relativePath#9043
Startrekzky merged 2 commits into
mainfrom
kw-ensure-relpath

Conversation

@klesh

@klesh klesh commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renamed GetURIStringPointer to ResolveRequestURI and added a doc comment explaining its resolution semantics.
  • Added validation that relativePath must be a relative reference: url.URL.ResolveReference silently discards the base URL when the reference is absolute (scheme://...) or protocol-relative (//host/...), which would send the request to the wrong host with no error. Now this returns a BadInput error instead.
  • Updated both call sites (ApiClient.Do and the GitHub plugin's refreshApiClient.do).

Test plan

  • go build ./helpers/pluginhelper/api/... ./plugins/github/token/... passes
  • No other callers or tests reference the old function name (verified via repo-wide search)

🤖 Generated with Claude Code

klesh and others added 2 commits August 11, 2026 15:31
…ject absolute relativePath

url.URL.ResolveReference silently discards the base URL when the reference
is absolute or protocol-relative, which would make the request target the
wrong host without any error. Validate relativePath up front and document
the resolution semantics on the renamed function.

@Startrekzky Startrekzky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Startrekzky
Startrekzky merged commit 82cab8b into main Aug 11, 2026
10 checks passed
@Startrekzky
Startrekzky deleted the kw-ensure-relpath branch August 11, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants