Sha256: 5d130cca64c21dd9c5e41b727f41d63be26a4dcda534e8ec8b47635da07d4d51

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

require 'rack'
module Trafficlogger
	class AnalyticFilter
		def initialize(app)
	    @app = app
	  end

	  def call(env)
	    status, headers, response = @app.call(env)
	    if !headers.nil? && !headers["Content-Type"].nil? && headers["Content-Type"].include?("text/html")
	      req = Rack::Request.new(env)
	      unless req.env["PATH_INFO"].starts_with?("/traffic_analytics")
	        Analytic.logger(req)
	      end
	    end
	    [status, headers, response]
	  end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trafficlogger-1.0.0 config/initializers/trafficlogger/analytic_filter.rb