tshield 0.5.0.0 → 0.5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tshield/configuration.rb +5 -0
- data/lib/tshield/controllers/requests.rb +4 -0
- data/lib/tshield/request.rb +8 -3
- data/lib/tshield/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0b94c2d88dce848c777da771bf9998367c34614
|
4
|
+
data.tar.gz: 7bf66c15f1956234c3f50237ea151eadc9248637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22f267fe74d698b0f26648f41422bb500db7f3aae9691e66f5a35025d27c424bcca5d94381e238b029747208aef31494dbca806a2edde5da9e76c2b644e0df0
|
7
|
+
data.tar.gz: 8ba0e3ccbd325d415564b9f0d77424ecfdc781427caecb904053a78a61d5e44a2e3d2d12cfe7f6732268b0b8533ebc2fa1c13ed0409c19cda46730b413f02260
|
@@ -3,6 +3,7 @@ require 'yaml'
|
|
3
3
|
module TShield
|
4
4
|
class Configuration
|
5
5
|
|
6
|
+
attr_accessor :request
|
6
7
|
attr_accessor :domains
|
7
8
|
attr_writer :session_path
|
8
9
|
|
@@ -27,6 +28,10 @@ module TShield
|
|
27
28
|
domains[domain]['headers'] || {}
|
28
29
|
end
|
29
30
|
|
31
|
+
def get_name(domain)
|
32
|
+
domains[domain]['name'] || domain.gsub(/.*:\/\//, '')
|
33
|
+
end
|
34
|
+
|
30
35
|
def get_excluded_headers(domain)
|
31
36
|
domains[domain]['excluded_headers'] || []
|
32
37
|
end
|
data/lib/tshield/request.rb
CHANGED
@@ -19,6 +19,7 @@ module TShield
|
|
19
19
|
@path = path
|
20
20
|
@options = options
|
21
21
|
@configuration = TShield::Configuration.singleton
|
22
|
+
@options[:timeout] = @configuration.request['timeout']
|
22
23
|
request
|
23
24
|
end
|
24
25
|
|
@@ -47,6 +48,10 @@ module TShield
|
|
47
48
|
@domain ||= @configuration.get_domain_for(@path)
|
48
49
|
end
|
49
50
|
|
51
|
+
def name
|
52
|
+
@name ||= @configuration.get_name(domain)
|
53
|
+
end
|
54
|
+
|
50
55
|
def method
|
51
56
|
@options[:method].downcase
|
52
57
|
end
|
@@ -103,10 +108,10 @@ module TShield
|
|
103
108
|
Dir.mkdir(request_path) unless File.exists?(request_path)
|
104
109
|
end
|
105
110
|
|
106
|
-
|
107
|
-
Dir.mkdir(
|
111
|
+
name_path = File.join(request_path, name)
|
112
|
+
Dir.mkdir(name_path) unless File.exists?(name_path)
|
108
113
|
|
109
|
-
path_path = File.join(
|
114
|
+
path_path = File.join(name_path, safe_dir(@path))
|
110
115
|
Dir.mkdir(path_path) unless File.exists?(path_path)
|
111
116
|
|
112
117
|
method_path = File.join(path_path, method)
|
data/lib/tshield/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tshield
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Rubin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|