diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-17 02:30:02 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-17 02:30:02 +0300 |
commit | a0856cf7b94b76f5305f3dd49f6c2b2cc807ea99 (patch) | |
tree | a323ee9805c453369a53cc6ae99c59bc0fe4432a /lib/bitbucket_server/connection.rb | |
parent | a6b7c4ee3134f7713b0b65848f3a511225cc3b59 (diff) |
Fix BitbucketServer::Client failing with Webmock 3.5.1
Webmock 3.1.0 changed the behavior to return `nil` for the body if an
HTTP 204 No Content response were received
(https://github.com/bblimke/webmock/commit/b837e642782501a6904d0cb1aad391dd6f49ada3).
Update the Bitbucket Server connection to ignore these No Content
response codes.
Diffstat (limited to 'lib/bitbucket_server/connection.rb')
-rw-r--r-- | lib/bitbucket_server/connection.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bitbucket_server/connection.rb b/lib/bitbucket_server/connection.rb index 9c14b26c65a..fbd451efb23 100644 --- a/lib/bitbucket_server/connection.rb +++ b/lib/bitbucket_server/connection.rb @@ -77,6 +77,7 @@ module BitbucketServer private def check_errors!(response) + return if ActionDispatch::Response::NO_CONTENT_CODES.include?(response.code) raise ConnectionError, "Response is not valid JSON" unless response.parsed_response.is_a?(Hash) return if response.code >= 200 && response.code < 300 |