rack-useragent-filter 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rack/useragent/filter.rb +2 -2
- data/rack-useragent-filter.gemspec +1 -1
- data/test/test_helper.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
@@ -16,8 +16,8 @@ module Rack
|
|
16
16
|
|
17
17
|
def call(env)
|
18
18
|
request = Rack::Request.new(env)
|
19
|
-
useragent = ::UserAgent.parse(env["HTTP_USER_AGENT"])
|
20
|
-
if !detection_disabled_by_cookie?(request.cookies) && unsupported?(useragent)
|
19
|
+
useragent = ::UserAgent.parse(env["HTTP_USER_AGENT"].to_s)
|
20
|
+
if useragent.any? && !detection_disabled_by_cookie?(request.cookies) && unsupported?(useragent)
|
21
21
|
content = render_page(useragent)
|
22
22
|
[400, {"Content-Type" => "text/html", "Content-Length" => content.length.to_s}, content]
|
23
23
|
else
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack-useragent-filter}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tomasz Mazur", "Sergio Gil", "Luismi Cavall\303\251"]
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-useragent-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tomasz Mazur
|