Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Comments

fix(retrofit2): fix multiple slash issue in baseUrl of retrofit2 client (backport #1206)#1207

Merged
mergify[bot] merged 1 commit intorelease-1.37.xfrom
mergify/bp/release-1.37.x/pr-1206
Mar 22, 2025
Merged

fix(retrofit2): fix multiple slash issue in baseUrl of retrofit2 client (backport #1206)#1207
mergify[bot] merged 1 commit intorelease-1.37.xfrom
mergify/bp/release-1.37.x/pr-1206

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Mar 22, 2025

  • When a retrofit client baseUrl has multiple slashes(ex: https://somehost/api/v3/), the resulting url changes based on the whether there is a leading slash in the endpoint or not. If the endpoint is prefixed with a / (ex: /orgs/{org}/members) the resulting url omits the segment post first / from baseUrl.

  • The example above results in https://somehost/orgs/someorg/members instead of https://somehost/api/v3/orgs/someorg/members.

  • This PR addresses the issue by removing the leading / from all the endpoints and making sure the baseUrl ends with a trailing /

  • A test is added to demonstrate the issue.


This is an automatic backport of pull request #1206 done by [Mergify](https://mergify.com).

…nt (#1206)

* test(github): add a test to demonstrate an error scenario where if the baseUrl of the Github client has multiple slashes and the end point start with a slash

* fix(github): fix the error where if the baseUrl of the Github client has multiple slashes and the end point start with a slash, the resultant api url leaves that part the base url coming after first slash.

* refactor(api): refactor retrofit2 client configuration for FiatService to fix any issues that may occur if the base url has multiple slashes

* refactor(web): refactor retrofit2 client configuration for IgorApi, ClouddriverApi and Front50Api to fix any issues that may occur if the base url has multiple slashes

(cherry picked from commit a7f7f9d)
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Mar 22, 2025
@mergify mergify bot added the auto merged label Mar 22, 2025
@mergify mergify bot merged commit 6a2024e into release-1.37.x Mar 22, 2025
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants