Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added NSURLMatcher #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

None yet

1 participant