httplog 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1062236d98f41d145eead34fd281d61e87afc3dd79abd117dfdf2eebb601521e
4
- data.tar.gz: 6edc718624dc88ddeebc38e0f6507bb91f930579b08cf4a8c0cf3c445303e4e6
3
+ metadata.gz: 7f946d051687bf5b9619cef09c7f08924602dc299f30f252efabb9d8c32e9d9e
4
+ data.tar.gz: a3d37f01e85db1c2f4088f401834223bddebe491b3999b0944f3b3632f1d0591
5
5
  SHA512:
6
- metadata.gz: 67669745059fa38aa79498a4717566219b1aa9e9cc9262e017ecd518e1afa06183ff64b925d33ed2fc0833e6146f92dbca86b9fad83005c96f2851590f580821
7
- data.tar.gz: 9e478ad5b103b90911b600d30df17b84154a0c66afc740856601fd1466980aaf834c6fbafaa55f3bde38b258f352f91aa47d89bde5f2eb64b8cdf6e32f4f45c1
6
+ metadata.gz: 78568c78635c3f43067b3e43c1bc4bafd2867a908da22aae395b5d7ef0679d2f70fbf9b0d03b7efaaf1cd77886247a60286cc05c0d7a5118aef963a5afabfaa6
7
+ data.tar.gz: 6c145267890a60f8024070dc9e32f10fb54d354ba3f1dd040c0ac9190681af886c31bf636b6a246742e84225ae5ede6153198cd46d87add0ca39710f0a08a951
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 1.6.3 - 2023-02-25
2
+
3
+ * Dependecy updates
4
+ * [#137](https://github.com/trusche/httplog/pull/137) Fix case sensitivity on response headers
5
+
6
+ ## 1.6.2 - 2022-11-19
7
+
8
+ * Added rubygems.org metadata
9
+ * Gem dependency updates
10
+
11
+ ## 1.6.0 - 2022-09-17
12
+
13
+ * Gem upgrades
14
+ * [#110](https://github.com/trusche/httplog/pull/110) Fix for empty body response
15
+ * [#111](https://github.com/trusche/httplog/pull/111) Removed runtime dependencies
16
+ * Dependency updates
17
+ * Fix the missing Ethon log info #124
18
+
1
19
  ## 1.5.0 - 2021-05-20
2
20
 
3
21
  * Support for Ruby 2.7 and frozen strings
data/httplog.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |gem|
34
34
  gem.add_development_dependency 'excon', ['~> 0.60']
35
35
  gem.add_development_dependency 'faraday', ['~> 1.3']
36
36
  gem.add_development_dependency 'guard-rspec', ['~> 4.7']
37
- gem.add_development_dependency 'http', ['~> 4.0']
37
+ gem.add_development_dependency 'http', ['>= 4.0']
38
38
  gem.add_development_dependency 'httparty', ['~> 0.16']
39
39
  gem.add_development_dependency 'httpclient', ['~> 2.8']
40
40
  gem.add_development_dependency 'rest-client', ['~> 2.0']
@@ -47,8 +47,8 @@ if defined?(Ethon)
47
47
  @on_complete.unshift -> (*) do
48
48
  # Not sure where the actual status code is stored - so let's
49
49
  # extract it from the response header.
50
- encoding = response_headers.scan(/Content-Encoding: (\S+)/).flatten.first
51
- content_type = response_headers.scan(/Content-Type: (\S+(; charset=\S+)?)/).flatten.first
50
+ encoding = response_headers.scan(/Content-Encoding: (\S+)/i).flatten.first
51
+ content_type = response_headers.scan(/Content-Type: (\S+(; charset=\S+)?)/i).flatten.first
52
52
 
53
53
  # Hard to believe that Ethon wouldn't parse out the headers into
54
54
  # an array; probably overlooked it. Anyway, let's do it ourselves:
@@ -19,6 +19,7 @@ if defined?(::HTTPClient)
19
19
  request_uri = req.header.request_uri
20
20
  if HttpLog.url_approved?(request_uri)
21
21
  res = conn.pop
22
+ headers = res.headers.transform_keys(&:downcase)
22
23
 
23
24
  HttpLog.call(
24
25
  method: req.header.request_method,
@@ -27,10 +28,10 @@ if defined?(::HTTPClient)
27
28
  request_headers: req.headers,
28
29
  response_code: res.status_code,
29
30
  response_body: res.body,
30
- response_headers: res.headers,
31
+ response_headers: headers,
31
32
  benchmark: bm,
32
- encoding: res.headers['Content-Encoding'],
33
- content_type: res.headers['Content-Type'],
33
+ encoding: headers['content-encoding'],
34
+ content_type: headers['content-type'],
34
35
  mask_body: HttpLog.masked_body_url?(request_uri)
35
36
  )
36
37
  conn.push(res)
@@ -10,6 +10,8 @@ if defined?(Patron)
10
10
  end
11
11
 
12
12
  if HttpLog.url_approved?(url)
13
+ normalized_headers = @response.headers.transform_keys(&:downcase)
14
+
13
15
  HttpLog.call(
14
16
  method: action_name,
15
17
  url: url,
@@ -17,10 +19,10 @@ if defined?(Patron)
17
19
  request_headers: headers,
18
20
  response_code: @response.status,
19
21
  response_body: @response.body,
20
- response_headers: @response.headers,
22
+ response_headers: normalized_headers,
21
23
  benchmark: bm,
22
- encoding: @response.headers['Content-Encoding'],
23
- content_type: @response.headers['Content-Type'],
24
+ encoding: normalized_headers['content-encoding'],
25
+ content_type: normalized_headers['content-type'],
24
26
  mask_body: HttpLog.masked_body_url?(url)
25
27
  )
26
28
  end
@@ -319,6 +319,8 @@ module HttpLog
319
319
  string_classes << HTTP::URI if defined?(HTTP::URI)
320
320
  string_classes << URI::HTTP if defined?(URI::HTTP)
321
321
  string_classes << HTTP::FormData::Urlencoded if defined?(HTTP::FormData::Urlencoded)
322
+ string_classes << Addressable::URI if defined?(Addressable::URI)
323
+ string_classes << HTTPClient::Util::AddressableURI if defined?(HTTPClient::Util::AddressableURI)
322
324
  string_classes
323
325
  end
324
326
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HttpLog
4
- VERSION = '1.6.2'.freeze
4
+ VERSION = '1.6.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httplog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thilo Rusche
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-19 00:00:00.000000000 Z
11
+ date: 2024-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethon
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: http
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.0'
83
83
  - !ruby/object:Gem::Dependency
@@ -290,7 +290,7 @@ metadata:
290
290
  bug_tracker_uri: https://github.com/trusche/httplog/issues
291
291
  changelog_uri: https://github.com/trusche/httplog/blob/master/CHANGELOG.md
292
292
  source_code_uri: https://github.com/trusche/httplog
293
- post_install_message:
293
+ post_install_message:
294
294
  rdoc_options: []
295
295
  require_paths:
296
296
  - lib
@@ -305,8 +305,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  requirements: []
308
- rubygems_version: 3.3.7
309
- signing_key:
308
+ rubygems_version: 3.5.3
309
+ signing_key:
310
310
  specification_version: 4
311
311
  summary: Log outgoing HTTP requests.
312
312
  test_files: []