Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-02-17 02:30:02 +0300
committerStan Hu <stanhu@gmail.com>2019-02-17 02:30:02 +0300
commita0856cf7b94b76f5305f3dd49f6c2b2cc807ea99 (patch)
treea323ee9805c453369a53cc6ae99c59bc0fe4432a /lib/bitbucket_server
parenta6b7c4ee3134f7713b0b65848f3a511225cc3b59 (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')
-rw-r--r--lib/bitbucket_server/connection.rb1
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