module Cas module Client class Rack def initialize(app) @app = app end def call(env) puts "CAS Client Called from Rack!" status, headers, response = @app.call(env) response_body = "" response.each { |part| response_body += part } response_body += "CAS Client Called!!!" headers["Content-Length"] = response_body.length.to_s [status, headers, response_body] end end end end