Object
A Rack middleware for providing CSSHTTPRequest responses.
Proxies the request to the application then encodes the response with the CSSHTTPRequest encoder
# File lib/rack/contrib/csshttprequest.rb, line 14 def call(env) status, headers, response = @app.call(env) if chr_request?(env) response = encode(response) modify_headers!(headers, response) end [status, headers, response] end
# File lib/rack/contrib/csshttprequest.rb, line 23 def chr_request?(env) env['csshttprequest.chr'] ||= !(/\.chr$/.match(env['PATH_INFO'])).nil? || Rack::Request.new(env).params['_format'] == 'chr' end
Generated with the Darkfish Rdoc Generator 2.