-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
URLHelper::join()
does not respect full-url in $endpoint
#99
Comments
I agree that if the This would help me, as at the moment when connecting to the Xero Accounting API I have to create two connectors. One connector to authorize and another connector to get the token because Xero has different base URLs for each:
This means I would just be able to set the I don't think this would be a breaking change as it will not cause any existing code to be changed. I would be happy to create a PR if this is something that would be helpful. |
The
\Sammyjo20\Saloon\Helpers\URLHelper::join()
method does not respect a full URL in the$endpoint
argument but still prefixes it with the$baseUrl
.Some APIs have a few endpoints on another base URL/domain. I would like to override the default base URL with a full URL in the request endpoint instead of creating a whole new connector.
The already used
filter_var($endpoint, FILTER_VALIDATE_URL)
could be used to early return in case the$endpoint
is already a full and valid URL. Possibly also combined withparse_url()
to check scheme and host are defined.Right now I'm running in the following curl error which fully bubbles through all layers. Even with the
AlwaysThrowsOnErrors
trait it fully bubbles through and doesn't get wrapped up in a\GuzzleHttp\Exception\ConnectException
or similar.The text was updated successfully, but these errors were encountered: