Skip to content

Fix string matching for intercepted request URL patterns - #604

Merged
route merged 1 commit into
rubycdp:mainfrom
kanutocd:fix/intercepted-request-string-match
Jul 30, 2026
Merged

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

Conversation

@kanutocd

Copy link
Copy Markdown
Contributor

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.
@route
route merged commit 5370021 into rubycdp:main Jul 30, 2026
7 checks passed
route added a commit that referenced this pull request Jul 30, 2026
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

2 participants