fix(agent-client): normalize path joining in HttpRequester#1539
Open
fix(agent-client): normalize path joining in HttpRequester#1539
Conversation
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
When api_endpoint has no trailing slash and action endpoints have no leading slash, the URL concatenation produces broken paths like /backoffice/v1forest/actions/... instead of /backoffice/v1/forest/actions/... Extract a buildUrl() method that ensures the path always starts with / before concatenation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6d013f9 to
125d71d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
api_endpointhas no trailing slash (e.g.https://example.com/backoffice/v1) and action endpoints have no leading slash (e.g.forest/actions/my-action),HttpRequesterproduces broken URLs like/backoffice/v1forest/actions/...buildUrl()method that ensures the path always starts with/before concatenationquery()andstream()methodsTest plan
🤖 Generated with Claude Code
Note
Normalize path joining in
HttpRequesterto prevent malformed URLsExtracts URL construction into a private
buildUrl(path)method in http-requester.ts that ensures paths always have a leading/before joining withbaseUrl. Bothqueryandstreamnow use this helper instead of inline concatenation. A test covering paths without a leading slash is added in http-requester.test.ts.Macroscope summarized 125d71d.