Nocilla icon indicating copy to clipboard operation
Nocilla copied to clipboard

Added NSURLMatcher

Open nicklockwood opened this issue 8 years ago • 0 comments

This PR Adds an LSURLMatcher class, and updates LSStubRequest to use it instead of the regular LSStringMatcher.

The motivation for this is that LSStringMatcher is not content aware, and so creates false negatives when matching URLs that are equivalent but not identical. The most common example is when the query parameter order is different, e.g:

http://example.com?foo=bar&bar=foo
http://example.com?bar=foo&foo=bar

Query parameter order can be non-deterministic, as it depends on things like the order of enumeration of an NSDictionary, which is undocumented, and changes between iOS versions, or when using different enumeration methods.

nicklockwood avatar Jan 16 '17 13:01 nicklockwood