Skip to content

Commit

Permalink
Revert the default endpoint (dirty fix)
Browse files Browse the repository at this point in the history
This seems that "fixes" the issue with Faraday gem raising
"Faraday::ConnectionFailed: end of file reached". Remove this
commit when this issue
bitbucket-rest-api#71 gets
resolved.
  • Loading branch information
ispyropoulos committed Jun 11, 2016
1 parent d83641b commit 0a16cf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/bitbucket_rest_api/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module Configuration
DEFAULT_BASIC_AUTH = nil

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

# The value sent in the http header for 'User-Agent' if none is set
DEFAULT_USER_AGENT = "BitBucket Ruby Gem #{BitBucket::VERSION::STRING}".freeze
Expand Down
12 changes: 6 additions & 6 deletions spec/bitbucket_rest_api/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

describe "request" do
it "raises an ArgumentError if an unsupported HTTP verb is used" do
Expand All @@ -17,7 +17,7 @@
end

it "supports get" do
stub_request(:get, "https://api.bitbucket.org/1.0/endpoint").
stub_request(:get, "https://bitbucket.org/api/1.0/endpoint").
with(:headers => {
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
Expand All @@ -29,7 +29,7 @@
end

it "supports put" do
stub_request(:put, "https://api.bitbucket.org/1.0/endpoint").
stub_request(:put, "https://bitbucket.org/api/1.0/endpoint").
with(:body => "{\"data\":{\"key\":\"value\"}}",
:headers => {
'Accept' => '*/*',
Expand All @@ -42,7 +42,7 @@
end

it "supports patch" do
stub_request(:patch, "https://api.bitbucket.org/1.0/endpoint").
stub_request(:patch, "https://bitbucket.org/api/1.0/endpoint").
with(:body => "{\"data\":{\"key\":\"value\"}}",
:headers => {
'Accept' => '*/*',
Expand All @@ -55,7 +55,7 @@
end

it "supports delete" do
stub_request(:delete, "https://api.bitbucket.org/1.0/endpoint").
stub_request(:delete, "https://bitbucket.org/api/1.0/endpoint").
with(:headers => {
'Accept' => '*/*',
'Authorization' => 'Bearer 12345',
Expand All @@ -65,7 +65,7 @@
end

it "supports post" do
stub_request(:post, "https://api.bitbucket.org/1.0/endpoint").
stub_request(:post, "https://bitbucket.org/api/1.0/endpoint").
with(:body => "{\"data\":{\"key\":\"value\"}}",
:headers => {
'Accept' => '*/*',
Expand Down

0 comments on commit 0a16cf6

Please sign in to comment.