Open Nakilon opened 9 months ago
The String#match is doing funny things
String#match
irb(main):023:0> "vg?1".match "vg?1" => nil irb(main):024:0> "g?1".match "g?1" => #<MatchData "1">
here https://github.com/rubycdp/ferrum/blob/7ae00e7ce557c765f9dfcd75b5875cdc1cc186dd/lib/ferrum/network/intercepted_request.rb#L33 and since you send regex on url and not vice versa, I believe it isn't intended. So I propose to make it like this instead:
def match?(regexp) not not regexp === url end
because it was too surprising that when I added an exact url string it didn't match, such as "https://telegram.org/img/tgme/pattern.svg?1".
"https://telegram.org/img/tgme/pattern.svg?1"
Have no time to come up with a PR, just patched in a fork.
The
String#match
is doing funny thingshere https://github.com/rubycdp/ferrum/blob/7ae00e7ce557c765f9dfcd75b5875cdc1cc186dd/lib/ferrum/network/intercepted_request.rb#L33 and since you send regex on url and not vice versa, I believe it isn't intended. So I propose to make it like this instead:
because it was too surprising that when I added an exact url string it didn't match, such as
"https://telegram.org/img/tgme/pattern.svg?1"
.Have no time to come up with a PR, just patched in a fork.