perf_check 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/perf_check/server.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5210e19711849c1d31c9a59f11f3a7f492e9c48
|
4
|
+
data.tar.gz: e57b035135efc2569d20d3a18cb776c979894274
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588ac42f1b7b9b649f798395c8876430862f7fb6f56e56423172b65c8cc53f4a4390ceed18c1a73c2129649d54f3fcebc540dffce51f36f082ddc2ee9ffdc3a9
|
7
|
+
data.tar.gz: 85e004752e36cb9176ad4543dfee9d6ba9043d478ab58505f992b6267667ff2b0474040a3dae53717d8ddba3677b2b2ff5ea73a41b877f54bdc56135d5d0d8df
|
data/lib/perf_check/server.rb
CHANGED
@@ -18,17 +18,19 @@ class PerfCheck
|
|
18
18
|
|
19
19
|
controller.send(:define_method, :get_perf_check_session, &block)
|
20
20
|
controller.send(:define_method, action) do
|
21
|
-
|
21
|
+
login = params[:login_symbol].presence.try(:to_sym) || params[:login]
|
22
|
+
get_perf_check_session(login, params[:route])
|
22
23
|
render :nothing => true
|
23
24
|
end
|
24
25
|
controller.send(:skip_before_filter, :verify_authenticity_token)
|
25
26
|
|
26
27
|
authorization do |login, route|
|
27
28
|
http = Net::HTTP.new(host, port)
|
29
|
+
params = login.is_a?(Symbol) ? "login_symbol=#{login}" : "login=#{login}"
|
28
30
|
if method == :post
|
29
|
-
response = http.post(login_route,
|
31
|
+
response = http.post(login_route, params)
|
30
32
|
elsif method == :get
|
31
|
-
response = http.get(login_route+"
|
33
|
+
response = http.get(login_route+"?#{params}")
|
32
34
|
end
|
33
35
|
|
34
36
|
response['Set-Cookie']
|