diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/gitlab/jira | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/gitlab/jira')
-rw-r--r-- | lib/gitlab/jira/http_client.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/jira/http_client.rb b/lib/gitlab/jira/http_client.rb index 3e7659db240..13d3bb2b8dc 100644 --- a/lib/gitlab/jira/http_client.rb +++ b/lib/gitlab/jira/http_client.rb @@ -40,6 +40,14 @@ module Gitlab @authenticated = result.response.is_a?(Net::HTTPOK) store_cookies(result) if options[:use_cookies] + # This is needed to make response.to_s work. HTTParty::Response internal uses a Net::HTTPResponse as @response. + # When a block is used, Net::HTTPResponse#body will be a Net::ReadAdapter instead of a String. + # In this case HTTParty::Response.to_s will default to inspecting the Net::HTTPResponse class instead + # of returning the content of body. + # See https://github.com/jnunemaker/httparty/blob/v0.18.1/lib/httparty/response.rb#L86-L92 + # See https://github.com/ruby/net-http/blob/v0.1.1/lib/net/http/response.rb#L346-L350 + result.response.body = result.body + result end |