Skip to content

Added NSURLMatcher#152

Open
nicklockwood wants to merge 1 commit intolausobo:masterfrom
nicklockwood:url-compare
Open

Added NSURLMatcher#152
nicklockwood wants to merge 1 commit intolausobo:masterfrom
nicklockwood:url-compare

Conversation

@nicklockwood
Copy link

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.

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