[9.x] Do not prepend baseUrl to absolute urls #41307
Merged
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.
This is a non-breaking version of #41289.
Problem
I've created an HTTP macro to easily work with an API, just like the documentation suggests. The response of this API is paginated and the URL of the next page is returned in the response. This URL is absolute and making a request with a base URL and an absolute URL currently results in requests like
https://api.github.com/https://api.github.com/organizations/laravel
. Guzzle allows you to set a base URL and use absolute URL's in conjuction, so I'd expect this client to support that too.Solution
Guzzle follows RFC 3986 to resolve the URL against the base URL, but implementing the same logic will be a breaking change, as described in #41289 (comment). This fix is more naive and will only fix the base URL + absolute URL issue.