rack-noindex_https 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack-noindex_https.rb +1 -6
- data/lib/rack-noindex_https/version.rb +1 -1
- metadata +1 -1
data/lib/rack-noindex_https.rb
CHANGED
@@ -7,16 +7,11 @@ module Rack
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(env)
|
10
|
-
dup._call(env)
|
11
|
-
end
|
12
|
-
|
13
|
-
def _call(env)
|
14
10
|
puts "got here"
|
15
11
|
@status, @headers, @body = @app.call(env)
|
16
12
|
puts env.inspect
|
17
|
-
request = Rack::Request.new(env)
|
18
13
|
|
19
|
-
if
|
14
|
+
if env['rack.url_scheme'] == 'https' && (@headers['Content-Type'] =~ /application\/html/ || @headers['Content-Type'] =~ /text\/html/)
|
20
15
|
@body = @body.collect {|fragement| puts "updating"; fragement.gsub(%r{</head>}, '<meta name="robots" content="noindex"></head>') }
|
21
16
|
end
|
22
17
|
|