rack-traffic-logger 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 +4 -4
- data/lib/rack/traffic_logger/version.rb +1 -1
- data/lib/rack/traffic_logger.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a455d4887387282d5194961bad8442b7f05d1cd
|
4
|
+
data.tar.gz: 6bfc39d711eebf00a9c93f6e2035f70ea524babe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489b81dcb76375c24c0bdc8d9e933494c7134d4264aa3ef83e6176176ae6d32768b7f1ff226323404198dfe51a0612b52d3aa0cf6e951bf35f059dcb48e7d1ff
|
7
|
+
data.tar.gz: c51a533ccbc5868fc9a7f44cb0f7f6355d362eb51aa9cc1badd70011871adcd9ab328ef6b09a840676dfeb53c1a944983e64e6ae5f7d02f07ce6f0d3e51f4302
|
data/lib/rack/traffic_logger.rb
CHANGED
@@ -128,6 +128,7 @@ module Rack
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def log_body!(body, type: nil, encoding: nil)
|
131
|
+
return unless body
|
131
132
|
body = Zlib::GzipReader.new(StringIO.new body).read if encoding == 'gzip'
|
132
133
|
body = JSON.pretty_generate(JSON.parse body) if type[/[^;]+/] == 'application/json' && pretty_print
|
133
134
|
body = "<#BINARY #{body.bytes.length} bytes>" if body =~ /[^[:print:]\r\n\t]/
|