Skip to content
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

[9.x] Do not prepend baseUrl to absolute urls #41307

Merged
merged 2 commits into from
Mar 3, 2022
Merged

[9.x] Do not prepend baseUrl to absolute urls #41307

merged 2 commits into from
Mar 3, 2022

Conversation

JaZo
Copy link
Contributor

@JaZo JaZo commented Mar 3, 2022

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.

@taylorotwell taylorotwell merged commit e7dc913 into laravel:9.x Mar 3, 2022
@JaZo JaZo deleted the feature/ignore-base-url-for-absolute-urls-non-breaking branch March 7, 2022 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants