lib/cas/client/rack.rb in cas-client-0.1.2.pre.p16 vs lib/cas/client/rack.rb in cas-client-0.1.2.pre.p17

- old
+ new

@@ -4,16 +4,14 @@ def initialize(app) @app = app end def call(env) - puts "CAS Client Called from Rack!" status, headers, rack_body = @app.call(env) puts "Middleware called. Status: #{status}, Headers: #{headers}" - if rack_body.respond_to?("body") && rack_body.body.class == String - response = rack_body.body - response += "CAS Client Called!!!" + if status == 401 + response = "CAS Client Called!!!" headers["Content-Length"] = response.length.to_s return [status, headers, [response]] else return [status, headers, rack_body] end