-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make url scheme and host match and register case insensitive #222
Conversation
cef2d5b
to
7bf4433
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix! 🎉 Perhaps add a couple of unit tests to Route+TrieRouter_RouteTests
that check for case-insensitive matches.
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
=======================================
Coverage 94.84% 94.84%
=======================================
Files 97 97
Lines 3198 3200 +2
=======================================
+ Hits 3033 3035 +2
Misses 165 165
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! 💪
Some suggestions:
- please add some new unit tests to check new behavior 🤓
- the PR title (and final commit) could still be improved: perhaps "Make route scheme and host checks case insensitive"? 💅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Just some minor tweaks left IMO 👍
Tests/AlicerceTests/DeepLinking/Route+TrieRouter_RouteTests.swift
Outdated
Show resolved
Hide resolved
Currently the mapping and register of url routes are case sensitive The RFC-3986 states that theses routes should be case insensitive - Add case insensitive url routes mapping and register logic - Add UnitTests to test, said logic - Conform to RFC-3986
Checklist
master
Motivation and Context
The current implementation did not account for RFC-3986, and by doing so if the user entered an URL with a capital letters in the scheme or the host the match would fail.
By complying to the norm, this behaviour is now accounted for, and the issue is fixed.
Description
Forcing the scheme and host from the user's input URL to be lowercased before parsing them to the match method.
Changed a UnitTest to accommodate to the base code changes.
Tested applying the code to a working project and running the app on a physical device to debug the deep links and universal links