Sha256: ba296910cbab14479134ff0f1ec6e78bdfad402e31371fc788d375ad3b0fe8ab
Contents?: true
Size: 552 Bytes
Versions: 21
Compression:
Stored size: 552 Bytes
Contents
# encoding: utf-8 # TODO: it can be in rack-contrib module Rango module Middlewares class EmailObfuscator def initialize(app) @app = app end def call(env) status, headers, body = @app.call(env) if headers["Content-Type"] == "text/html" body = self.substitute(body) end [status, headers, body] end # TODO: is it OK everywhere? E. g. <script> or <style> def substitute(body) body.map { |chunk| chunk.gsub!("@", "@") } end end end end
Version data entries
21 entries across 21 versions & 1 rubygems