glib-web 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/glib/json_crawler/http.rb +1 -1
- data/lib/glib/json_crawler/router.rb +8 -1
- 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: 33a24d2b8f825c118967862ffc1aea083a5c715a54de262fee3f46d0d51ae2e9
|
4
|
+
data.tar.gz: 7852230e7d601634393ece59a82c6a41b878365e0527944396ec670dc32b9ddd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1487b7831601dc5a93020b9fc61f787bbafd99b412ec1e6f77b57221e5c568b177e2579437d8329df6380ec2801b8c232ba8bbc6c533ca4fd6b05caa3676ac9
|
7
|
+
data.tar.gz: 1d05949731d66def274208d84f6350e718f1fbe153397df4f7ef1daa1ca6aa81a7887682c8b86a3413537f563b6222dc103171cbaa8dc17124d73c2c08c13d07
|
@@ -102,7 +102,7 @@ module Glib
|
|
102
102
|
if (code = response.code) == 302
|
103
103
|
redirect_uri = URI(response.headers['Location'])
|
104
104
|
redirect_uri.query = [redirect_uri.query, 'format=json'].compact.join('&')
|
105
|
-
get redirect_uri.to_s, action, params if
|
105
|
+
get redirect_uri.to_s, action, params if router.allowed?(redirect_uri.to_s)
|
106
106
|
else
|
107
107
|
response_times << response.headers['X-Runtime'].to_f
|
108
108
|
|
@@ -54,9 +54,11 @@ module Glib
|
|
54
54
|
when 'runMultiple-v1', 'runMultiple'
|
55
55
|
JsonCrawler::RunMultiple.new(http, params, action)
|
56
56
|
when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1', 'windows/open', 'dialogs/open', 'windows/reload', 'windows/openWeb', 'windows/openWeb-v1'
|
57
|
-
if params['url']
|
57
|
+
if allowed?(params['url'])
|
58
58
|
@read_only_actions.add([action, params['url']])
|
59
59
|
JsonCrawler::WindowsOpen.new(http, params, action)
|
60
|
+
else
|
61
|
+
self.log action, params['url']
|
60
62
|
end
|
61
63
|
when 'sheets/select-v1', 'sheets/select'
|
62
64
|
JsonCrawler::Menu.new(http, params, action)
|
@@ -90,6 +92,11 @@ module Glib
|
|
90
92
|
def crawl_multiple(views, block)
|
91
93
|
@visitor.traverse_multiple views, block
|
92
94
|
end
|
95
|
+
|
96
|
+
def allowed?(url)
|
97
|
+
regex = Regexp.new("#{host}.+(?<!\.pdf)$")
|
98
|
+
regex.match(url)
|
99
|
+
end
|
93
100
|
end
|
94
101
|
end
|
95
102
|
end
|