sniffer 0.3.0 → 0.3.1

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
- SHA1:
3
- metadata.gz: 1a09ca069eb76f2fc329bf27351cc2499138ca6d
4
- data.tar.gz: cb8e52bd4c2ad6ffe509ea85c7a1df80d5d79489
2
+ SHA256:
3
+ metadata.gz: 1df847d342d16a8c26cf1e9711fab6baf465444524ea9eb1e404b2b762a228c8
4
+ data.tar.gz: 28cbd39a08076ef975e9370d6d49d926a169b6cc1368fd35ee33de96611e1d58
5
5
  SHA512:
6
- metadata.gz: c34b3b15837f64f6a7c9e45c71fa5f2392854122eb6f462656553a27aa12c875be6146cb0b0aacbe182c229ba2516ea41c8b0431dab33bf16e6f6a88b7f5f9e5
7
- data.tar.gz: 0dac7a4e9d90125899d8100d168e5659c37d872b514f57cc94867ac0750b53f5ce2accc2d7527a38d48efa6cd20cf1e91d72b1f8e2c37b6f29fa91232668237f
6
+ metadata.gz: ddb474fcfce55fb0875bd27df8a89a35be9ff1516fba2dc3778e2423823a85200cf27970f88efce3508bfcc8c57edc29d3b422755ce7c7d4eb9b22935d8eb3df
7
+ data.tar.gz: b71fb9b1be1d0715a2b4b2fd856d119ca5e7372cc52c759328e17f4ab714ab68fefbe7b7da1a0183763496ed9ed9f9cfb30a1ad3d35547596bb94b5a305f3aab
data/README.md CHANGED
@@ -190,6 +190,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/aderya
190
190
  ## Acknowledge
191
191
 
192
192
  * [Sergey Ponomarev](https://github.com/sponomarev)
193
+ * [Vladimir Dementyev](https://github.com/palkan)
193
194
  * [Salahutdinov Dmitry](https://github.com/dsalahutdinov)
194
195
  * [Stanislav Chereshkevich](https://github.com/dissident)
195
196
  * [Anatoliy Kurichev](https://github.com/russo-matrosso)
@@ -39,7 +39,7 @@ module Sniffer
39
39
  method: verb,
40
40
  query: query,
41
41
  headers: headers.collect.to_h,
42
- body: body.to_s,
42
+ body: body,
43
43
  port: uri.port)
44
44
 
45
45
  Sniffer.store(data_item)
@@ -52,7 +52,7 @@ module Sniffer
52
52
  if Sniffer.enabled?
53
53
  data_item.response = Sniffer::DataItem::Response.new(status: @res.code,
54
54
  headers: @res.headers.collect.to_h,
55
- body: @res.body.to_s,
55
+ body: @res.body,
56
56
  timing: bm)
57
57
 
58
58
  data_item.log
@@ -18,7 +18,7 @@ module Sniffer
18
18
  end
19
19
 
20
20
  def log
21
- return unless allowed_to_sniff?
21
+ return unless Sniffer.logger && allowed_to_sniff?
22
22
  Sniffer.logger.log(Sniffer.config.severity, to_json)
23
23
  end
24
24
 
@@ -59,7 +59,7 @@ module Sniffer
59
59
  query: query,
60
60
  port: port,
61
61
  headers: headers,
62
- body: body,
62
+ body: body && body.to_s,
63
63
  method: method
64
64
  }
65
65
  end
@@ -80,7 +80,7 @@ module Sniffer
80
80
  end
81
81
 
82
82
  hash[:method] = method if log_settings["request_method"]
83
- hash[:request_body] = body if log_settings["request_body"]
83
+ hash[:request_body] = body.to_s if log_settings["request_body"]
84
84
  end
85
85
  end
86
86
  end
@@ -94,7 +94,7 @@ module Sniffer
94
94
  {
95
95
  status: status,
96
96
  headers: headers,
97
- body: body,
97
+ body: body && body.to_s,
98
98
  timing: timing
99
99
  }
100
100
  end
@@ -111,7 +111,7 @@ module Sniffer
111
111
  end
112
112
 
113
113
  hash[:timing] = timing if log_settings["timing"]
114
- hash[:response_body] = body if log_settings["response_body"]
114
+ hash[:response_body] = body.to_s if log_settings["response_body"]
115
115
  end
116
116
  end
117
117
  # rubocop:enable Metrics/AbcSize
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sniffer
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sniffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Deryabin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-12 00:00:00.000000000 Z
11
+ date: 2018-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -303,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
303
  version: '0'
304
304
  requirements: []
305
305
  rubyforge_project:
306
- rubygems_version: 2.6.14
306
+ rubygems_version: 2.7.4
307
307
  signing_key:
308
308
  specification_version: 4
309
309
  summary: Analyze HTTP Requests