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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc4198e0e65b71f2c5dba0cb2949b15b75c7cb119777b4b1363436e36775d0d7
4
- data.tar.gz: 832751899e20e37b0a306085f654cf7280837e98852e468935bf577df652d7ae
3
+ metadata.gz: 33a24d2b8f825c118967862ffc1aea083a5c715a54de262fee3f46d0d51ae2e9
4
+ data.tar.gz: 7852230e7d601634393ece59a82c6a41b878365e0527944396ec670dc32b9ddd
5
5
  SHA512:
6
- metadata.gz: 7bb9e0f8aff21560ddb76a2f762727a657348d28151edfac43a11277a6e0cc569cd2987d4f9fee7dd43737f2de65a245fc97ced83dad66d3049d5934d4df2106
7
- data.tar.gz: 4e24503ed4f2fe887856c65fca7d34ee4c71ff6829b43f4510477a7ffc58d8a63877f7c1752e67e000da2e6d0f41a93d405495678b63225e6d6a363b353706ca
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 redirect_uri.to_s.include?(router.host)
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'].to_s.include?(host)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''