chimera_http_client 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ad28c45175797378cfcab81479167a9d76538f1f438a82c5f79cedd48bb90dc
4
- data.tar.gz: f6aa79792c873c5ba537ff8d3a0885871a3040471b4aae93a6c7f29156aece1a
3
+ metadata.gz: 27502b5b2a10f00e43634863b14ce3d3d7ac3b957a9bcde7f239e0ee73124f55
4
+ data.tar.gz: bd5697952a9e4a24b54e6fffb32ca6aadef39c28404bdfd60f00d0c1dd611f11
5
5
  SHA512:
6
- metadata.gz: 8cec762f1ff0088d978d9c6b1eae68157ea8fd6058e14192ff2b2fe3d07d54e0d9573f89f6a64f4860380a2fb61232f550f3e782869274a6d36ba47ce0579eac
7
- data.tar.gz: 843ff440917c8af2bdf1b7c662d39b4ef481f736ee7be6776d2bc958de1c36f1d591ab81c7cd206eaf269e0d28354b84962dbf5264b5323bac357d0fb691ecc2
6
+ metadata.gz: 4db5ae181cefef0408b6e2f9586c96f0a311211b7d6b71a9c7ddf3960acb906e7873620b338b8231f42fd3ff999a9c3eeacd98a6f56d2e7345f1704f00bcca93
7
+ data.tar.gz: 515e85c5020b526c6d9d064987355b9c28652ecd9b628d63de176a6dfffbe7fb273a2b7527ae0a9d4aee8128ea5d4cb8f89426f48c4b1d6e778c7d49481b4af5
@@ -10,11 +10,9 @@ module ChimeraHttpClient
10
10
  @logger = options[:logger]
11
11
  @monitor = options[:monitor]
12
12
  @timeout = options[:timeout]
13
-
14
- Typhoeus::Config.cache = options[:cache]
15
- Typhoeus::Config.memoize = false # hydra setting, prevents a possible memory leak
16
- Typhoeus::Config.user_agent = options.fetch(:user_agent, USER_AGENT)
17
- Typhoeus::Config.verbose = options.fetch(:verbose, false)
13
+ @cache = options[:cache]
14
+ @user_agent = options.fetch(:user_agent, USER_AGENT)
15
+ @verbose = options.fetch(:verbose, false)
18
16
  end
19
17
 
20
18
  private
@@ -22,6 +20,8 @@ module ChimeraHttpClient
22
20
  # Add default values to call options
23
21
  def augmented_options(options)
24
22
  options[:timeout] ||= @timeout
23
+ options[:cache] = @cache if options[:cache].nil?
24
+ options[:verbose] = @verbose if options[:verbose].nil?
25
25
 
26
26
  options
27
27
  end
@@ -41,7 +41,7 @@ module ChimeraHttpClient
41
41
  end
42
42
 
43
43
  def default_headers
44
- { "Content-Type" => "application/json" }
44
+ { "Content-Type" => "application/json", "User-Agent" => @user_agent }
45
45
  end
46
46
 
47
47
  def default_deserializer
@@ -25,6 +25,7 @@ module ChimeraHttpClient
25
25
  timeout: options[:timeout] || TIMEOUT_SECONDS,
26
26
  accept_encoding: "gzip",
27
27
  cache: options[:cache],
28
+ verbose: options[:verbose],
28
29
  }
29
30
 
30
31
  # Basic-auth support:
@@ -52,7 +53,7 @@ module ChimeraHttpClient
52
53
  url: url,
53
54
  code: response.code,
54
55
  runtime: runtime,
55
- user_agent: Typhoeus::Config.user_agent,
56
+ user_agent: headers["User-Agent"],
56
57
  }
57
58
  )
58
59
 
@@ -66,7 +67,7 @@ module ChimeraHttpClient
66
67
  url: url,
67
68
  code: nil,
68
69
  runtime: 0,
69
- user_agent: Typhoeus::Config.user_agent,
70
+ user_agent: headers["User-Agent"],
70
71
  }
71
72
  )
72
73
 
@@ -1,3 +1,3 @@
1
1
  module ChimeraHttpClient
2
- VERSION = "1.7.0".freeze
2
+ VERSION = "1.7.1".freeze
3
3
  end
@@ -8,4 +8,6 @@ module ChimeraHttpClient
8
8
 
9
9
  # as Zeitwerk can't handle innner classes properly :-/
10
10
  require_relative "chimera_http_client/error"
11
+
12
+ Typhoeus::Config.memoize = false # hydra setting, prevents a possible memory leak
11
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimera_http_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Finger
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  - !ruby/object:Gem::Version
313
313
  version: '0'
314
314
  requirements: []
315
- rubygems_version: 3.6.7
315
+ rubygems_version: 3.6.9
316
316
  specification_version: 4
317
317
  summary: General http client functionality to quickly connect to JSON REST API endpoints
318
318
  and any others