Skip to content

Commit 0f1100a

Browse files
committed
Setting default endpoint to api.bitbucket.org
1 parent 8373f38 commit 0f1100a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/bitbucket_rest_api/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module Configuration
4949
DEFAULT_BASIC_AUTH = nil
5050

5151
# The endpoint used to connect to BitBucket if none is set, in the event that BitBucket is ever available on location
52-
DEFAULT_ENDPOINT = 'https://bitbucket.org/api'.freeze
52+
DEFAULT_ENDPOINT = 'https://api.bitbucket.org'.freeze
5353

5454
# The value sent in the http header for 'User-Agent' if none is set
5555
DEFAULT_USER_AGENT = "BitBucket Ruby Gem #{BitBucket::VERSION::STRING}".freeze

spec/bitbucket_rest_api/request_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
describe BitBucket::Request do
55
let(:fake_api) { (Class.new { include BitBucket::Request })}
6-
let(:faraday_connection) { Faraday.new(:url => 'https://bitbucket.org/api') }
6+
let(:faraday_connection) { Faraday.new(:url => 'https://api.bitbucket.org') }
77

88
describe "request" do
99
it "raises an ArgumentError if an unsupported HTTP verb is used" do
@@ -17,7 +17,7 @@
1717
end
1818

1919
it "supports get" do
20-
stub_request(:get, "https://bitbucket.org/api/1.0/repositories").
20+
stub_request(:get, "https://api.bitbucket.org/1.0/repositories").
2121
with(:headers => {
2222
'Accept' => '*/*',
2323
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
@@ -29,7 +29,7 @@
2929
end
3030

3131
it "supports put" do
32-
stub_request(:put, "https://bitbucket.org/api/1.0/repositories").
32+
stub_request(:put, "https://api.bitbucket.org/1.0/repositories").
3333
with(:body => { "data" => "payload" },
3434
:headers => {
3535
'Accept' => '*/*',
@@ -42,7 +42,7 @@
4242
end
4343

4444
it "supports patch" do
45-
stub_request(:patch, "https://bitbucket.org/api/1.0/repositories").
45+
stub_request(:patch, "https://api.bitbucket.org/1.0/repositories").
4646
with(:body => { "data" => "payload" },
4747
:headers => {
4848
'Accept' => '*/*',
@@ -55,7 +55,7 @@
5555
end
5656

5757
it "supports delete" do
58-
stub_request(:delete, "https://bitbucket.org/api/1.0/repositories").
58+
stub_request(:delete, "https://api.bitbucket.org/1.0/repositories").
5959
with(:headers => {
6060
'Accept' => '*/*',
6161
'Authorization' => 'Bearer 12345',
@@ -65,7 +65,7 @@
6565
end
6666

6767
it "supports post" do
68-
stub_request(:post, "https://bitbucket.org/api/1.0/repositories").
68+
stub_request(:post, "https://api.bitbucket.org/1.0/repositories").
6969
with(:body => { "data" => "payload" },
7070
:headers => {
7171
'Accept' => '*/*',

0 commit comments

Comments
 (0)