prerender_rails 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: b445e95eba89c9f2c17ef1bfba560d12d47ec6cb
4
- data.tar.gz: 119ded420f8926a35ffc37bc61bac6872f226f5d
3
+ metadata.gz: ec81d9470f347151a442c94c7ed1a39102d4bdde
4
+ data.tar.gz: 37567e7f03e9a2b163eb1d0a14e163ecee8530f0
5
5
  SHA512:
6
- metadata.gz: 7416c6e2b014f91ef21acd2fbe5713052725262b5855c4d14ebeff86012c62702378ea6e3ad8545f8f2b3b3ffa7ccefefb1bd821af77ef54b019edaac4009e08
7
- data.tar.gz: a4bdc217487a6814bf6d096d852733ada4a11a30f8a090925be4b618f343945f5b3a227272778af01d0ca3af7d4cb5377b0fd887f6984d398ebb35a8d68674f1
6
+ metadata.gz: e49da14a9f06eb1bceeb7ff0303d567b9418c4ffaa1e2e0b04796cb0c000541766c712864981c71517b1197ba266ce56c1872b9c030d83c09c4ac19767094312
7
+ data.tar.gz: 41ac300c1f8e7e1ee0c7b801ca6cf746893aec55f1b8a49baba070d9e994277ec9e5b687d775e228bfa2316570870c852c65b1c6a2046dd35cb98ce1527da72a
@@ -112,7 +112,9 @@ module Rack
112
112
  def get_prerendered_page_response(env)
113
113
  begin
114
114
  url = URI.parse(build_api_url(env))
115
- req = Net::HTTP::Get.new(url.request_uri, { 'User-Agent' => env['HTTP_USER_AGENT'] })
115
+ headers = { 'User-Agent' => env['HTTP_USER_AGENT'] }
116
+ headers['X-Prerender-Token'] = ENV['PRERENDER_TOKEN'] if ENV['PRERENDER_TOKEN']
117
+ req = Net::HTTP::Get.new(url.request_uri, headers)
116
118
  response = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
117
119
  rescue
118
120
  nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "prerender_rails"
5
- spec.version = "0.1.6"
5
+ spec.version = "0.1.7"
6
6
  spec.authors = ["Todd Hooper"]
7
7
  spec.email = ["todd@collectiveip.com"]
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: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Hooper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2013-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack