http_store 0.3.3 → 0.3.4
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 -1
- data/lib/http_store/helpers/storable.rb +3 -3
- data/lib/http_store/middleware/request_log.rb +4 -1
- data/lib/http_store/version.rb +1 -1
- data/lib/http_store.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbad1b169cfaefecb2f2c7a96b916d382e109c8ff89c7104340974a9061013f0
|
4
|
+
data.tar.gz: 8957ccdac995dcaacb30b40b0e4cbe3c53b06fcacf92344b741515dd3c8cbbfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a52092f8d72dcac74d88662e7cc5ecf361be80526d6ebb8908fd448f28e7f1a6c7107ccdb972bc640f672b3e572d310585c31dfc4219ad36ccc769a28d5c494
|
7
|
+
data.tar.gz: 9a14abb12047c30f3afd11c1218ee068ee4a3de9da46291024f872087aca09303351538d0bdd1b1ca26e45c855cae840adb413cb564326e4a9ad36b8adb213be
|
data/Gemfile.lock
CHANGED
@@ -33,10 +33,10 @@ module HttpStore
|
|
33
33
|
when Array
|
34
34
|
value.map { |v| storable(v) }
|
35
35
|
when String
|
36
|
-
json = JSON.parse(
|
37
|
-
json ? storable(json) : storable_string(
|
36
|
+
json = JSON.parse(value) rescue nil
|
37
|
+
json ? storable(json) : storable_string(value)
|
38
38
|
else
|
39
|
-
|
39
|
+
value.try(:to_h) || value.try(:to_a) || value
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -20,12 +20,15 @@ module HttpStore
|
|
20
20
|
def build_meta(env, status, headers, body)
|
21
21
|
request = ActionDispatch::Request.new(env)
|
22
22
|
|
23
|
-
@meta = format_req(request)
|
23
|
+
@meta = Hashie::Mash.new(format_req(request))
|
24
24
|
@meta.merge!(format_rsp(status, headers, body))
|
25
25
|
end
|
26
26
|
|
27
27
|
def format_req(request)
|
28
28
|
{
|
29
|
+
url: request.url,
|
30
|
+
path: request.path,
|
31
|
+
http_method: request.request_method,
|
29
32
|
data: request.params,
|
30
33
|
headers: request.headers.select { |k, _v| k.start_with? 'HTTP_' }.to_h,
|
31
34
|
query_params: request.query_parameters
|
data/lib/http_store/version.rb
CHANGED
data/lib/http_store.rb
CHANGED