Skip to content

Fix string matching for intercepted request URL patterns#604

Open
kanutocd wants to merge 1 commit into
rubycdp:mainfrom
kanutocd:fix/intercepted-request-string-match
Open

Fix string matching for intercepted request URL patterns#604
kanutocd wants to merge 1 commit into
rubycdp:mainfrom
kanutocd:fix/intercepted-request-string-match

Conversation

@kanutocd

Copy link
Copy Markdown

Summary

  • Fix Ferrum::Network::InterceptedRequest#match? so string patterns match URLs literally
  • Preserve regular expression matching for existing blacklist, whitelist, and request interception usage
  • Add regression coverage for URL strings containing regex metacharacters

Closes #405.

Verification

  • bundle exec rspec spec/network/intercepted_request_spec.rb
  • bundle exec rspec spec/network/intercepted_request_spec.rb spec/network_spec.rb
  • bundle exec rubocop lib/ferrum/network/intercepted_request.rb spec/network/intercepted_request_spec.rb

- Use Ruby case matching semantics for intercepted request URL patterns so exact string patterns are compared literally instead of being treated as regexps.
- This preserves regexps matching while fixing blacklist and whitelist patterns containing regex metacharacters such as query string question marks.
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.

consider using === in network blacklist matching

1 participant