browser 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/gemfiles/rails3.gemfile.lock +1 -1
- data/lib/browser/middleware.rb +4 -0
- data/lib/browser/version.rb +1 -1
- 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: 1376f80279d81e3c05481520af650c371bf08fb4
|
4
|
+
data.tar.gz: 0e395d31bdfe73b696b4b6a414946d93efca202d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128e49d7d296d6bdd2fa6ab3ea250637dd3b570d4feb9585c8632b6a41c71e8e411e179d24354e228b5584842dbd685a4a9a75510f05831e2bbf6ca773c376d6
|
7
|
+
data.tar.gz: ce47534aba74621bc089c9d30f6aaf7611cf996ed4cfef04570eb2582c84e3e99bd7b0129dae9a928fe01f704227392f3a482c1bff27dcfa17b9fe09bf5fd19d
|
data/Gemfile.lock
CHANGED
data/lib/browser/middleware.rb
CHANGED
@@ -2,6 +2,9 @@ require "uri"
|
|
2
2
|
|
3
3
|
class Browser
|
4
4
|
class Middleware
|
5
|
+
# Detect the most common assets.
|
6
|
+
ASSETS_REGEX = %r[\.(css|png|jpe?g|gif|js|svg|ico|flv|mov|m4v|ogg|swf)\z]i
|
7
|
+
|
5
8
|
def initialize(app, &block)
|
6
9
|
raise ArgumentError, "Browser::Middleware requires a block" unless block
|
7
10
|
|
@@ -46,6 +49,7 @@ class Browser
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def html?(request)
|
52
|
+
return if request.path.match(ASSETS_REGEX)
|
49
53
|
request.env["HTTP_ACCEPT"].to_s.include?("text/html")
|
50
54
|
end
|
51
55
|
end
|
data/lib/browser/version.rb
CHANGED