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