-
Notifications
You must be signed in to change notification settings - Fork 654
fix(retrofit2): fix baseUrl must end in /
error
#1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
…alArgumentException: baseUrl must end in /.
dbyron-sf
reviewed
Feb 26, 2025
echo-core/src/main/java/com/netflix/spinnaker/echo/util/RetrofitUtils.java
Outdated
Show resolved
Hide resolved
dbyron-sf
reviewed
Feb 26, 2025
echo-core/src/main/java/com/netflix/spinnaker/echo/util/RetrofitUtils.java
Show resolved
Hide resolved
…aseUrl and removing leading / in the end point: java.lang.IllegalArgumentException: baseUrl must end in /.
d904a17
to
90e18af
Compare
d7e1a63
to
36460da
Compare
… and add a test class to demonstrate the behaviour. Here are some references that justify this change: square/retrofit#907, square/retrofit#1701
36460da
to
ec9e140
Compare
dbyron-sf
approved these changes
Feb 27, 2025
@Mergifyio backport release-1.37.x |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Feb 27, 2025
* test(retrofit2): add a test to demonstrate the error: java.lang.IllegalArgumentException: baseUrl must end in /. * fix(retrofit2): fix the following error by adding trailing / in the baseUrl and removing leading / in the end point: java.lang.IllegalArgumentException: baseUrl must end in /. * fix(retrofit2): fix RestService by replacing POST mapping from / to . and add a test class to demonstrate the behaviour. Here are some references that justify this change: square/retrofit#907, square/retrofit#1701 (cherry picked from commit 19e2f34)
mergify bot
added a commit
that referenced
this pull request
Feb 27, 2025
* test(retrofit2): add a test to demonstrate the error: java.lang.IllegalArgumentException: baseUrl must end in /. * fix(retrofit2): fix the following error by adding trailing / in the baseUrl and removing leading / in the end point: java.lang.IllegalArgumentException: baseUrl must end in /. * fix(retrofit2): fix RestService by replacing POST mapping from / to . and add a test class to demonstrate the behaviour. Here are some references that justify this change: square/retrofit#907, square/retrofit#1701 (cherry picked from commit 19e2f34) Co-authored-by: Kiran Godishala <[email protected]>
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.
Retrofit2 client configuration doesn't allow baseUrl without tailing slash(
/
) if there is a slash in the middle. As a resulthttps://somehost
andhttps://somehost:3333
becomes valid buthttps://somehost/api
throwsjava.lang.IllegalArgumentException: baseUrl must end in /
.This PR addresses the issue by checking and adding trailing
/
if missing and removing the leading/
from the endpoint.