resurfaceio-logger 1.7.12 → 1.7.13
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c17088af0b23ce7e7b628caad14177d7f4f2aec
|
4
|
+
data.tar.gz: 505409bfbd5e5a4307910ae5d52e307acec2ece9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5daf6545f69459a832e2497cccf7009aee2bf0003ebf0dcd2022a9d56b343eb573b5b3e76995884e80bafe4346143a3d5cfcde180d029caa325b732bd33efb2
|
7
|
+
data.tar.gz: 51e1490b8813e1acd6acd14872b458f2cd612e3ca5da0d128dcff62c53c03d32554ba7eb9a870056af14361c4c7a1969bbdcee5168d932c4d4e4b8b8b1834474
|
@@ -31,6 +31,10 @@ class HttpLogger < BaseLogger
|
|
31
31
|
!enabled? || submit(format(request, request_body, response, response_body))
|
32
32
|
end
|
33
33
|
|
34
|
+
def string_content_type?(s)
|
35
|
+
!s.nil? && s =~ /^(text\/(html|plain|xml))|(application\/(json|soap|xml|x-www-form-urlencoded))/i
|
36
|
+
end
|
37
|
+
|
34
38
|
protected
|
35
39
|
|
36
40
|
def append_request_headers(message, request)
|
@@ -13,9 +13,9 @@ class HttpLoggerForRack # http://rack.rubyforge.org/doc/SPEC.html
|
|
13
13
|
|
14
14
|
def call(env)
|
15
15
|
status, headers, body = @app.call(env)
|
16
|
-
if @logger.enabled? && status
|
16
|
+
if @logger.enabled? && status < 300
|
17
17
|
response = Rack::Response.new(body, status, headers)
|
18
|
-
if string_content_type?(response.content_type)
|
18
|
+
if @logger.string_content_type?(response.content_type)
|
19
19
|
request = Rack::Request.new(env)
|
20
20
|
@logger.log(request, nil, response, nil)
|
21
21
|
end
|
@@ -23,10 +23,4 @@ class HttpLoggerForRack # http://rack.rubyforge.org/doc/SPEC.html
|
|
23
23
|
[status, headers, body]
|
24
24
|
end
|
25
25
|
|
26
|
-
protected
|
27
|
-
|
28
|
-
def string_content_type?(s)
|
29
|
-
!s.nil? && s =~ /^(text\/(html|plain|xml))|(application\/(json|soap|xml|x-www-form-urlencoded))/i
|
30
|
-
end
|
31
|
-
|
32
26
|
end
|
@@ -11,7 +11,10 @@ class HttpLoggerForRails
|
|
11
11
|
|
12
12
|
def around(controller)
|
13
13
|
yield
|
14
|
-
|
14
|
+
response = controller.response
|
15
|
+
if response.status < 300 && @logger.string_content_type?(response.content_type)
|
16
|
+
@logger.log(controller.request, nil, response, nil)
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resurfaceio-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RobDickinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|