Enforce Trailing Slash On Go RPC URLs#17
Merged
THEjacob1000 merged 1 commit intomasterfrom Mar 5, 2026
Merged
Conversation
THEjacob1000
commented
Mar 5, 2026
Comment on lines
+54
to
+56
| func normalizeBaseURL(baseURL string) string { | ||
| return strings.TrimRight(baseURL, "/") + "/" | ||
| } |
Contributor
Author
There was a problem hiding this comment.
mimicked functionality from @loke/http-rpc-client: https://github.com/LOKE/loke-http-rpc-client/blob/master/src/client.ts#L17-L19
smithamax
reviewed
Mar 5, 2026
Comment on lines
+26
to
+30
| { | ||
| name: "collapses multiple trailing slashes", | ||
| baseURL: "http://example.com/rpc/service///", | ||
| expected: "http://example.com/rpc/service/", | ||
| }, |
Member
There was a problem hiding this comment.
Not that it really matters, but it probably shouldn't strip multiple /
smithamax
approved these changes
Mar 5, 2026
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.
Internal change only
This pull request improves the handling of base URLs in the
lokerpcclient by ensuring they are consistently normalized. It introduces a utility function to standardize base URLs and adds comprehensive tests to verify this behavior.Submitter Checklist
Check only those that apply to this change.
Testing Evidence
What evidence supports that you have tested this change?
Reviewer Checklist
Note: if this PR affects authentication or payments please seek a secondary tester.