prerender_rails 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prerender_rails.rb +4 -0
- data/prerender_rails.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db685df40cb56db49ec9ec692fe48ac300fcab08
|
4
|
+
data.tar.gz: b4602eb9e00e3cbf97ea8aed467211695765b158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57f92a2d64f32826258d5687734568629d00b6d8e9c58a4db132278b83dcf740244d440566ff9e6f46bb3f05dabab57ef05a165e0d64666ecf109a22c86592df
|
7
|
+
data.tar.gz: aea4c87bac266fe036da034d9ab7dc051b41685f02e18c4d20b543b379c182cfd8209220627d95dad6deb279eca621a2c568a789eb5d541c90c0e900c4768c94
|
data/lib/prerender_rails.rb
CHANGED
@@ -115,6 +115,7 @@ module Rack
|
|
115
115
|
def should_show_prerendered_page(env)
|
116
116
|
user_agent = env['HTTP_USER_AGENT']
|
117
117
|
buffer_agent = env['X-BUFFERBOT']
|
118
|
+
prerender_agent = env['X-PRERENDER']
|
118
119
|
is_requesting_prerendered_page = false
|
119
120
|
|
120
121
|
return false if !user_agent
|
@@ -130,6 +131,9 @@ module Rack
|
|
130
131
|
#if it is BufferBot...show prerendered page
|
131
132
|
is_requesting_prerendered_page = true if buffer_agent
|
132
133
|
|
134
|
+
#if it is Prerender...don't show prerendered page
|
135
|
+
is_requesting_prerendered_page = false if prerender_agent
|
136
|
+
|
133
137
|
#if it is a bot and is requesting a resource...dont prerender
|
134
138
|
return false if @extensions_to_ignore.any? { |extension| request.fullpath.include? extension }
|
135
139
|
|
data/prerender_rails.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "prerender_rails"
|
5
|
-
spec.version = "1.
|
5
|
+
spec.version = "1.5.0"
|
6
6
|
spec.authors = ["Todd Hooper"]
|
7
7
|
spec.email = ["todd@prerender.io"]
|
8
8
|
spec.description = %q{Rails middleware to prerender your javascript heavy pages on the fly by a phantomjs service}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prerender_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Hooper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|