lib/cas/client/rack.rb in cas-client-0.1.2.pre.p12 vs lib/cas/client/rack.rb in cas-client-0.1.2.pre.p13
- old
+ new
@@ -8,14 +8,17 @@
def call(env)
puts "CAS Client Called from Rack!"
status, headers, rack_body = @app.call(env)
puts "Middleware called. Status: #{status}, Headers: #{headers}"
- response = rack_body.body
- response += "CAS Client Called!!!"
- headers["Content-Length"] = response.length.to_s
-
- [status, headers, [response]]
+ if rack_body.class == RackBody && rack_body.body.class == String
+ response = rack_body.body
+ response += "CAS Client Called!!!"
+ headers["Content-Length"] = response.length.to_s
+ return [status, headers, [response]]
+ else
+ return [status, headers, rack_body]
+ end
end
end
end
end