rack-noindex_https 0.0.4 → 0.0.5
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 +1 -5
- metadata +1 -1
data/lib/rack-noindex_https.rb
CHANGED
@@ -7,16 +7,12 @@ module Rack
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(env)
|
10
|
-
puts "got here"
|
11
10
|
@status, @headers, @body = @app.call(env)
|
12
|
-
puts env.inspect
|
13
11
|
|
14
12
|
if env['rack.url_scheme'] == 'https' && (@headers['Content-Type'] =~ /application\/html/ || @headers['Content-Type'] =~ /text\/html/)
|
15
|
-
@body = @body.collect {|fragement|
|
13
|
+
@body = @body.collect {|fragement| fragement.gsub(%r{</head>}, '<meta name="robots" content="noindex"></head>') }
|
16
14
|
end
|
17
15
|
|
18
|
-
puts 'finished'
|
19
|
-
|
20
16
|
[@status, @headers, @body]
|
21
17
|
end
|
22
18
|
end
|