You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client base URL example sets the base URL to
"http://example.com/api/v1", which is then joined with a URI of
"/posts.json". This had two bugs:
- The base url did not end with '/', and so 'v1' was treated as a file
path, and dropped from the result. This lead to resulting URLs like:
"http://example.com/api/posts.json", without the 'v1'.
- the joined URI (/posts.json) begins with a '/', and so it was treated as an absolute
path from the domain. This lead to resulting URLs like:
"http://example.com/posts.json", without the '/api/v1'.
This commit fixes both of these bugs in the example. It also adds a note
to the documentation (copied from the URL crate) about the importance of
the ending '/'.
One test was added to ensure the base_url behavior.
0 commit comments