glib-web 0.6.2 → 0.6.6

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: 5f6803ad260efc33294f643a2a623e418a260b24b18729142aeb41f6a6d891c9
4
+ data.tar.gz: e3c581588cff960a60857cd63aa904dae41a81da4a86596b2bf17275353acca9
5
5
  SHA512:
6
- metadata.gz: 7bb9e0f8aff21560ddb76a2f762727a657348d28151edfac43a11277a6e0cc569cd2987d4f9fee7dd43737f2de65a245fc97ced83dad66d3049d5934d4df2106
7
- data.tar.gz: 4e24503ed4f2fe887856c65fca7d34ee4c71ff6829b43f4510477a7ffc58d8a63877f7c1752e67e000da2e6d0f41a93d405495678b63225e6d6a363b353706ca
6
+ metadata.gz: 1de3a468c5f82b9d4ee70afc5763e1ab9f31e4ff54cbb14ed891ff546b867db084a6c5d091cc4cb70d6f75fc24b0fe052c169beb6edc4e3c3e96beefe3208574
7
+ data.tar.gz: c7cd87a3e9399c9b03730eee4a16f679af1d55eada9b0a4468129a122306a5ef54d42e4c3a9ef39617a320d38cadc00e08ca60255443abaeae6b7944034172ce
@@ -35,6 +35,18 @@ module Glib::Analytics
35
35
  segment = request.headers['GApp-Analytics-Referer-Segment']
36
36
  placement = request.headers['GApp-Analytics-Referer-Placement']
37
37
 
38
+ if group.nil? && action.nil? && !request.headers['referer'].nil?
39
+ if request.headers['referer'].start_with?("http://#{request.host}",
40
+ "https://#{request.host}",
41
+ "http://www.#{request.host}",
42
+ "https://www.#{request.host}")
43
+
44
+ route = Rails.application.routes.recognize_path(request.headers['referer'].delete_suffix('/'))
45
+ group = route[:controller]
46
+ action = route[:action]
47
+ end
48
+ end
49
+
38
50
  if group && action
39
51
  return { group: group, action: action, segment: segment, placement: placement }
40
52
  end
@@ -34,6 +34,7 @@ module Glib
34
34
  hash :valueIf
35
35
  hash :analytics
36
36
  hash :tooltip
37
+ hash :dataset
37
38
 
38
39
  # def initialize(json, page)
39
40
  # super(json, page)
@@ -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.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''