logtail-rack 0.1.3 → 0.1.4

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: c4b9576a2e94a8591830fff3268b33d6f503b7530b25808e7f67f0ed417af623
4
- data.tar.gz: '08b698d12becef45820e18fba233ba6d97e36f27cc77627c634626624d84f852'
3
+ metadata.gz: 6a02f0a952f983288ff3a6a639f1bfd2bd25c3384f472f47202a4e1f7a17dadc
4
+ data.tar.gz: 16941f12523dc9b12447eadfbe95941a0cf904b085d9b6d1c5649fab96cba3a4
5
5
  SHA512:
6
- metadata.gz: f817365f9c82b5c76b5d4ad9aecc15c7f4b54d0f863363527e712e78d3ba923295bff2f40cd557818687065eb360f65a2c349d6d1fb8b352a283c65881a2287c
7
- data.tar.gz: 8031a60fbbf6627bbc065119e75ad34f875bd921fb606669f5240a4c8381628e1e684d2bedce1b0c8aa70926ee905663d419788eb50797d169b830d7e2bed082
6
+ metadata.gz: 627b5bcc2f7c76f7ef410e6483cf52df9e70816f97856a1f4c56c3eee7e5b60624dd263623c3ce579bd22cb36747ed9df8c3d012807b325fdc7a51dd790d7ac4
7
+ data.tar.gz: 17c0e3a0648755a9fa64e9e2a80b48a297a953f7548deec1089944d5734ea1686d75b33bc84f9b2b9bd05f9d689fdec3dbbbc9dff202013716e6df86a949edcc
@@ -142,7 +142,7 @@ module Logtail
142
142
 
143
143
  Config.instance.logger.info do
144
144
  http_context = CurrentContext.fetch(:http)
145
- content_length = headers[CONTENT_LENGTH_KEY]
145
+ content_length = safe_to_i(headers[CONTENT_LENGTH_KEY])
146
146
  duration_ms = (Time.now - start) * 1000.0
147
147
 
148
148
  http_response = HTTPResponse.new(
@@ -180,7 +180,7 @@ module Logtail
180
180
  event_body = capture_request_body? ? request.body_content : nil
181
181
  http_request = HTTPRequest.new(
182
182
  body: event_body,
183
- content_length: request.content_length,
183
+ content_length: safe_to_i(request.content_length),
184
184
  headers: request.headers,
185
185
  host: force_encoding(request.host),
186
186
  method: request.request_method,
@@ -217,7 +217,7 @@ module Logtail
217
217
 
218
218
  Config.instance.logger.info do
219
219
  event_body = capture_response_body? ? body : nil
220
- content_length = headers[CONTENT_LENGTH_KEY]
220
+ content_length = safe_to_i(headers[CONTENT_LENGTH_KEY])
221
221
  duration_ms = (Time.now - start) * 1000.0
222
222
 
223
223
  http_response = HTTPResponse.new(
@@ -272,6 +272,10 @@ module Logtail
272
272
  end
273
273
  end
274
274
 
275
+ def safe_to_i(val)
276
+ val.nil? ? nil : val.to_i
277
+ end
278
+
275
279
  def force_encoding(value)
276
280
  if value.respond_to?(:force_encoding)
277
281
  value.dup.force_encoding('UTF-8')
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rack
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logtail
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-11 00:00:00.000000000 Z
11
+ date: 2021-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail
@@ -86,7 +86,7 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '3.0'
89
- description:
89
+ description:
90
90
  email:
91
91
  - hi@logtail.com
92
92
  executables: []
@@ -120,7 +120,7 @@ metadata:
120
120
  homepage_uri: https://github.com/logtail/logtail-ruby-rack
121
121
  source_code_uri: https://github.com/logtail/logtail-ruby-rack
122
122
  changelog_uri: https://github.com/logtail/logtail-ruby-rack/blob/master/README.md
123
- post_install_message:
123
+ post_install_message:
124
124
  rdoc_options: []
125
125
  require_paths:
126
126
  - lib
@@ -135,8 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.1.2
139
- signing_key:
138
+ rubygems_version: 3.2.3
139
+ signing_key:
140
140
  specification_version: 4
141
141
  summary: Logtail integration for Rack
142
142
  test_files: []