moesif_rack 1.4.6 → 1.4.7

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
- SHA1:
3
- metadata.gz: 4bc6206e2ea8335d66262ad33e0d6ea90a908e60
4
- data.tar.gz: f64dedab2b3c2d34fd24a4106417a5610e2bf429
2
+ SHA256:
3
+ metadata.gz: 4433b35813e25a0c20462510ff87fb2bb9849dff3edce0c5857884e1535dadb7
4
+ data.tar.gz: 9710968ac3ddfb6cb075e9d0ab5403d93a2e9b7830f5abb1da434ae7e11f907c
5
5
  SHA512:
6
- metadata.gz: 31dfb4d45baec6e9aa896cb995ed811806b349faa27a79aad737d5974bc5123e43429fb6cae5db96cc5b5f569989d63cb98af26738e8907bf3ac88c965918261
7
- data.tar.gz: f25cf1e4ddbbe87e37d8a58a0863d03dbe4e5e2111ae768395d1d2d8a4d58a162016d30f2fcb158e93f95409626be37608d73f76949795fbe583da931bce6afa
6
+ metadata.gz: f3139d61e5b5e086e6543e40dd09ac9e2c4703f92b611ade3525a559589a9b7070afef1421c92da4ef39a653814c5c0b306dc818c43092c11352b933b74ee19f
7
+ data.tar.gz: 83529f4a1bebb1e28a096fd43897e3ebd5357892d64961da7208ba1d0862ddad3ca6f1baaaff5384b0003a25dabc220958fa2a5ccec80905f2e5e87e3b87a774
data/README.md CHANGED
@@ -206,7 +206,12 @@ Optional. A Proc that takes env, headers, body and returns a boolean.
206
206
 
207
207
  moesif_options['skip'] = Proc.new { |env, headers, body|
208
208
  # Add your custom code that returns true to skip logging the API call
209
- false
209
+ if env.key?("REQUEST_URI")
210
+ # Skip probes to health page
211
+ env["REQUEST_URI"].include? "/health"
212
+ else
213
+ false
214
+ end
210
215
  }
211
216
 
212
217
  ```
@@ -102,7 +102,10 @@ module MoesifRack
102
102
 
103
103
  def parse_body(body, headers)
104
104
  begin
105
- if start_with_json(body)
105
+ if (body.instance_of?(Hash) || body.instance_of?(Array))
106
+ parsed_body = body
107
+ transfer_encoding = 'json'
108
+ elsif start_with_json(body)
106
109
  parsed_body = JSON.parse(body)
107
110
  transfer_encoding = 'json'
108
111
  elsif headers.key?('content-encoding') && ((headers['content-encoding'].downcase).include? "gzip")
@@ -341,6 +344,9 @@ module MoesifRack
341
344
 
342
345
  def get_response_body(response)
343
346
  body = response.respond_to?(:body) ? response.body : response
347
+ if (body.instance_of?(Hash) || body.instance_of?(Array))
348
+ return body
349
+ end
344
350
  body = body.inject("") { |i, a| i << a } if (body.respond_to?(:each) && body.respond_to?(:inject))
345
351
  body.to_s
346
352
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moesif_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moesif, Inc
8
8
  - Xing Wang
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-07-09 00:00:00.000000000 Z
12
+ date: 2020-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -81,7 +81,7 @@ metadata:
81
81
  mailing_list_uri: https://github.com/Moesif/moesif-rack
82
82
  source_code_uri: https://github.com/Moesif/moesif-rack
83
83
  wiki_uri: https://github.com/Moesif/moesif-rack
84
- post_install_message:
84
+ post_install_message:
85
85
  rdoc_options: []
86
86
  require_paths:
87
87
  - lib
@@ -96,9 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.5.2.3
101
- signing_key:
99
+ rubygems_version: 3.1.4
100
+ signing_key:
102
101
  specification_version: 4
103
102
  summary: moesif_rack
104
103
  test_files: []