Created
October 28, 2014 05:51
-
-
Save takai/e281459c73a2cd8b5c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParameterFilterProcessor | |
def self.create(filters) | |
Class.new(Raven::Processor::Processor) do | |
@filters = filters | |
def initialize(client = nil) | |
@parameter_filter = ActionDispatch::Http::ParameterFilter.new(self.class.filters) | |
end | |
def process(value) | |
if value['request'] && value['request']['query_string'].present? | |
query = Rack::Utils.parse_query(value['request']['query_string']) | |
filtered = @parameter_filter.filter(query) | |
value['request']['query_string'] = Rack::Utils.build_query(filtered) | |
end | |
@parameter_filter.filter(value) | |
end | |
def self.filters | |
@filters | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment