Skip to content

Commit 2a2549f

Browse files
committed
Drop /api/v4 suffix from site parameter documentation
Due to the change in ruby-oauth/oauth2#469 to fix relative URLs, linchus#22 was updated to drop the `api/v4` suffix from the `site` parameter. This was needed since `oauth/authorize` is the new default parameter, and omitting a leading slash makes a big difference. Current: ``` Faraday.new('https://gitlab.example.com').build_url('oauth/authorize').to_s => "https://gitlab.example.com/oauth/authorize" ``` However, if you leave the `api/v4` suffix, you get the wrong URL: ``` Faraday.new('https://gitlab.example.com/api/v4').build_url('oauth/authorize').to_s => "https://gitlab.example.com/api/v4/oauth/authorize" ``` Notice a leading slash also works: ``` Faraday.new('https://gitlab.example.com/api/v4').build_url('/oauth/authorize').to_s => "https://gitlab.example.com/oauth/authorize" ```
1 parent 39ad1f9 commit 2a2549f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Or install it yourself as:
3434
provider :gitlab, ENV['GITLAB_KEY'], ENV['GITLAB_SECRET'],
3535
{
3636
client_options: {
37-
site: 'https://gitlab.YOURDOMAIN.com/api/v4'
37+
site: 'https://gitlab.YOURDOMAIN.com'
3838
}
3939
}
4040
end

spec/omniauth/strategies/gitlab_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:parsed_response) { double('ParsedResponse') }
66
let(:response) { double('Response', parsed: parsed_response) }
77

8-
let(:enterprise_site) { 'https://some.other.site.com/api/v3' }
8+
let(:enterprise_site) { 'https://some.other.site.com' }
99

1010
let(:gitlab_service) { OmniAuth::Strategies::GitLab.new({}) }
1111
let(:enterprise) do

0 commit comments

Comments
 (0)