-
Notifications
You must be signed in to change notification settings - Fork 290
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
Problems with base_url #285
Comments
However, note that if you set the trailing slash in [27] pry(main)> http.base_url = 'https://test.com/v1/'
"https://test.com/v1/"
[28] pry(main)> http.send :to_resource_url, 'test'
{
:scheme => "https",
:user => nil,
:password => nil,
:host => "test.com",
:port => 443,
:path => "/v1/test",
:query => nil,
:fragment => nil
}
[29] pry(main)> http.send :to_resource_url, '/test'
{
:scheme => "https",
:user => nil,
:password => nil,
:host => "test.com",
:port => 443,
:path => "/test",
:query => nil,
:fragment => nil
} |
Note too that the appended resource cannot have a leading slash.
This issue looks to be a regression since it was not present in version 2.5.2 which I had been using. Looks like urify(@base_url + uri) to urify(@base_url) + uri |
And add work-arounds for nahi/httpclient#285
Thanks @vincentwoo and @awood, and sorry for the regression. Obviously the document is obviously untrue. Expected behavior for me and OK/NG of 2.7.0.1 implementation.
I'm unsure if my above expectation No.1 is right or not. I'm now thinking that current implementation Anyway it was a breaking change and sorry for any inconvenience it caused. |
I think the feature is now more confusing, but if you believe this to be the correct decision, it's your call. I think the docs do not cover what happens when:
Should you get
|
Is a severe regression against 2.6.1 which produced |
And add work-arounds for nahi/httpclient#285
And add work-arounds for nahi/httpclient#285
And add work-arounds for nahi/httpclient#285
Currently, the docs say that you can use
base_url
in this way:httpclient/lib/httpclient.rb
Line 395 in 837d59f
Reproduced here:
However, this is actually untrue - the base url must end with a slash or it will be ignored:
This problem occurs on version
2.7.0.1
and may be related to #269.The text was updated successfully, but these errors were encountered: