akita-har_logger 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -3
- data/akita-har_logger.gemspec +0 -2
- data/lib/akita/har_logger/har_entry.rb +0 -1
- data/lib/akita/har_logger/har_utils.rb +11 -0
- data/lib/akita/har_logger/http_request.rb +14 -6
- data/lib/akita/har_logger/http_response.rb +0 -1
- data/lib/akita/har_logger/version.rb +1 -1
- data/lib/akita/har_logger/writer_thread.rb +0 -2
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90d947db8a7fb0e4c9188ed34e7275e4697bb9380991f9a734999fe5e0350ab
|
4
|
+
data.tar.gz: eb5d3fc053f127f1da20fff703c2a16db0ed667c824dc1172c184a3989ac9ac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b1a61bfed03c77f5f0bd777211255f809beb535767154a294078dabed3ddadccaf6907205cab69a6c5087013567f7848584fe34c0f1795c4e127e5448e254ca
|
7
|
+
data.tar.gz: 1eb5fcb88a1b874929710ab249e4d40332cc2fec3cfdd4a5e637d38694ecb7cf434f2d5578c838299736cb26ba820254256a7077b29ddd7a0f81c943b145a190
|
data/Gemfile.lock
CHANGED
data/akita-har_logger.gemspec
CHANGED
@@ -14,6 +14,17 @@ module Akita
|
|
14
14
|
})
|
15
15
|
}
|
16
16
|
end
|
17
|
+
|
18
|
+
# Determines whether all values in a Hash are strings.
|
19
|
+
def self.allValuesAreStrings(hash)
|
20
|
+
hash.each do |_, value|
|
21
|
+
if !(value.is_a? String) then
|
22
|
+
return false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
return true
|
27
|
+
end
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'json'
|
4
3
|
require_relative 'har_utils'
|
5
4
|
|
6
5
|
module Akita
|
@@ -81,12 +80,21 @@ module Akita
|
|
81
80
|
# populate 'text.
|
82
81
|
req = Rack::Request.new env
|
83
82
|
if env['CONTENT_TYPE'] == 'application/x-www-form-urlencoded' then
|
84
|
-
# Decoded parameters can be found as a map in req.params.
|
85
|
-
# this map into an array.
|
83
|
+
# Decoded parameters can be found as a map in req.params.
|
86
84
|
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
|
85
|
+
# Requests originating from specs can be malformed: the values in
|
86
|
+
# req.params are not necessarily strings. Encode all of req.params
|
87
|
+
# in JSON and pretend the content type was "application/json".
|
88
|
+
if HarUtils.allValuesAreStrings req.params then
|
89
|
+
# Convert req.params into an array.
|
90
|
+
#
|
91
|
+
# XXX Spec has space for files, but are file uploads ever
|
92
|
+
# URL-encoded?
|
93
|
+
result[:params] = HarUtils.hashToList req.params
|
94
|
+
else
|
95
|
+
result[:mimeType] = 'application/json'
|
96
|
+
result[:text] = req.params.to_json
|
97
|
+
end
|
90
98
|
else
|
91
99
|
result[:text] = req.body.string
|
92
100
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akita-har_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jed Liu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.3'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.3'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rspec
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|