Skip to content

Feature/masking#74

Merged
trusche merged 8 commits intomasterfrom
feature/masking
May 18, 2019
Merged

Feature/masking#74
trusche merged 8 commits intomasterfrom
feature/masking

Conversation

@trusche
Copy link
Copy Markdown
Owner

@trusche trusche commented May 13, 2019

No description provided.

@trusche
Copy link
Copy Markdown
Owner Author

trusche commented May 13, 2019

Hi @bustikiller, I re-implemented your feature requests slightly differently - would you mind taking a look and let me know a) what you think and b) if this works for your use case?

Thanks!

Comment thread lib/httplog/http_log.rb
string_classes << URI::HTTP if defined?(URI::HTTP)
string_classes << HTTP::FormData::Urlencoded if defined?(HTTP::FormData::Urlencoded)
string_classes
end
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important to avoid dependencies on http libraries that are not used...

Comment thread lib/httplog/http_log.rb
case msg
when *string_classes
config.filter_parameters.reduce(msg) do |m,key|
m.to_s.gsub(/(#{key})=[^&]+/i, "#{key}=#{PARAM_MASK}")
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit more robust, just \w+ would only replace up to the first possible whitespace, URL encoded or not. Not terribly pretty but is might suffice and is less complex than parsing the full query string into a hash.

@trusche trusche requested a review from bustikiller May 13, 2019 16:43
@trusche trusche merged commit 97762b2 into master May 18, 2019
@trusche trusche deleted the feature/masking branch January 11, 2020 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant