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