arachni-typhoeus 0.2.0.1 → 0.2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/typhoeus/request.rb +14 -9
- data/lib/typhoeus/utils.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.0.
|
1
|
+
0.2.0.2
|
data/lib/typhoeus/request.rb
CHANGED
@@ -110,18 +110,23 @@ module Typhoeus
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def params_string
|
113
|
-
params.
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
113
|
+
traverse_hash(params).flatten.join('&')
|
114
|
+
end
|
115
|
+
|
116
|
+
def traverse_hash(hash, current_key = nil)
|
117
|
+
hash.keys.sort { |a, b| a.to_s <=> b.to_s }.collect do |key|
|
118
|
+
new_key = current_key ? "#{current_key}[#{key}]" : key
|
119
|
+
if hash[key].is_a?(Hash)
|
120
|
+
traverse_hash(hash[key], new_key)
|
121
|
+
elsif hash[key].is_a?(Array)
|
122
|
+
array_key = Typhoeus::Utils.escape("#{new_key}[]")
|
123
|
+
hash[key].collect { |v| "#{array_key}=#{Typhoeus::Utils.escape(v.to_s)}" }.join('&')
|
120
124
|
else
|
121
|
-
"#{Typhoeus::Utils.escape(
|
125
|
+
"#{Typhoeus::Utils.escape(new_key)}=#{Typhoeus::Utils.escape(hash[key].to_s)}"
|
122
126
|
end
|
123
|
-
end
|
127
|
+
end
|
124
128
|
end
|
129
|
+
private :traverse_hash
|
125
130
|
|
126
131
|
def on_complete(&block)
|
127
132
|
@on_complete = block
|
data/lib/typhoeus/utils.rb
CHANGED
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.2.0.
|
9
|
+
- 2
|
10
|
+
version: 0.2.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Dix
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-02-
|
19
|
+
date: 2011-02-19 00:00:00 +00:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|