sbsm 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/sbsm/session.rb +2 -2
- data/lib/sbsm/version.rb +1 -1
- data/test/test_session.rb +6 -0
- 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: 4d571577c95ff6d71831c663d7472e277db43caa
|
4
|
+
data.tar.gz: a48912ed3413eb301e44a4c77fdc25d93cccadff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b3360d408d609c1400d0ffd038960b0507489e8bd5b66ec76275e4eaad82b1643fbd4f0e97c8008169a528699205d2125c5ca8a9dd3bb29191e69fc0f2c7ba
|
7
|
+
data.tar.gz: 628c2b1c6e2f25afe69fe6d839c434febf1a6f3ecee33690b6b3386e7881c484b1d16529d4385927a70afbc126d85a42ace5365c0484e2e680f4807a674038f2
|
data/History.txt
CHANGED
data/lib/sbsm/session.rb
CHANGED
@@ -210,8 +210,8 @@ module SBSM
|
|
210
210
|
begin
|
211
211
|
@passthru = false
|
212
212
|
@disposition = false
|
213
|
-
@request_path ||= rack_request.path
|
214
213
|
@rack_request = rack_request
|
214
|
+
@request_path ||= rack_request.path
|
215
215
|
@post_content = nil
|
216
216
|
|
217
217
|
if rack_request.request_method.eql?('POST')
|
@@ -395,7 +395,7 @@ module SBSM
|
|
395
395
|
end
|
396
396
|
def is_crawler?
|
397
397
|
crawler_pattern = /archiver|slurp|bot|crawler|jeeves|spider|\.{6}/i
|
398
|
-
!!crawler_pattern.match(@rack_request.user_agent)
|
398
|
+
!!(@rack_request && crawler_pattern.match(@rack_request.user_agent))
|
399
399
|
end
|
400
400
|
def language
|
401
401
|
cookie_set_or_get(:language) || default_language
|
data/lib/sbsm/version.rb
CHANGED
data/test/test_session.rb
CHANGED
@@ -421,4 +421,10 @@ class TestSession < Minitest::Test
|
|
421
421
|
@session.process_rack(rack_request: @request)
|
422
422
|
assert_equal(true, @session.is_crawler?)
|
423
423
|
end
|
424
|
+
def test_is_crawler_nil_rack_request
|
425
|
+
@request.user_agent = 'google crawler'
|
426
|
+
@session.process_rack(rack_request: @request)
|
427
|
+
@session.rack_request = nil
|
428
|
+
assert_equal(false, @session.is_crawler?)
|
429
|
+
end
|
424
430
|
end
|