-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: add base_url parsing #2399
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
base: master
Are you sure you want to change the base?
Conversation
65ee65e to
ac07cc9
Compare
| Some(ref base_url) => Url::options() | ||
| .base_url(Some(base_url)) | ||
| .parse(url.as_str()) | ||
| .map_err(crate::error::builder) | ||
| .and_then(IntoUrlSealed::into_url), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only part of the code I find suspect, as maybe this should live in IntoUrl. I was not too sure on the best way to make changes there without changing the trait (that I was trying to avoid).
For the base_url behaviour, I have deferred to how it is implemented in the Url crate. This is documented here: https://docs.rs/url/latest/url/struct.Url.html#method.join
d580249 to
46f5a11
Compare
46f5a11 to
9413ca2
Compare
|
Hey @peddermaster2 , thanks for your approval! I have rebased it and fixed the git conflicts. |
9413ca2 to
b9a0e5b
Compare
b9a0e5b to
b351908
Compare
This adds support for
base_urlto the client when making a request.Changes
ClientBuilder::base_urlfor setting a base url for the client.Client::sendto use the base url, if it is set.Implements #988