-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Bugfix FXIOS-14375 DefaultURLFormatter not handling urls properly for < iOS 17 #31209
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
Bugfix FXIOS-14375 DefaultURLFormatter not handling urls properly for < iOS 17 #31209
Conversation
ab9b5be to
9f6f3b5
Compare
| /** | ||
| Returns whether the URL's scheme is one of those listed on the official list of URI schemes. | ||
| This only accepts permanent schemes: historical and provisional schemes are not accepted. | ||
| */ | ||
| public func schemeIsValid(for url: URL) -> Bool { | ||
| guard let scheme = url.scheme else { return false } | ||
| return SchemesDefinition.permanentURISchemes.contains(scheme.lowercased()) | ||
| && url.absoluteString.lowercased() != scheme + ":" | ||
| } |
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.
Copied over from our schemeIsValid code in our URL extension
9f6f3b5 to
49f01d3
Compare
|
Note: This was the only similar PR I found - #26101 Seems like we handled percent encoding in the past but not specifically mentioning iOS 17 change under the hood. |
💪 Quality guardian1 tests files modified. You're a champion of test coverage! 🚀 🧹 Tidy commitJust 2 file(s) touched. Thanks for keeping it clean and review-friendly! 🙌 Friday high-fiveThanks for pushing us across the finish line this week! 🙌 💬 Description craftsmanGreat PR description! Reviewers salute you 🫡 ❌ Per-file test coverage gateThe following changed file(s) are below 35.0% coverage:
Generated by 🚫 Danger Swift against cb28ce5 |
lmarceau
left a comment
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.
Small comment otherwise LGTM
Co-authored-by: lmarceau <[email protected]>
|
🚀 PR merged to |
📜 Tickets
Jira ticket
Github issue
💡 Description
This test
testGetURLGivenAboutConfigSpaceURLThenValidEscapedURLwas failing for versions < iOS 17. This is because Apple changed howURL(string: xxx)works under the hood. The test was failing forabout: configbecause it was returningnilinstead ofabout:%20config. This is due to older versions not automatically adding the percent encoding, see more details in the doc: https://developer.apple.com/documentation/foundation/url/init(string:)Note: The URLFormatted is currently not being used and discussed with @lmarceau that we eventually want to use the new
DefaultURLFormatterbut has not been prioritized. For now, we will add a fix specifically for iOS 17 and we revert the fix that was merged as part of this PR.cc: @yoanarios
📝 Checklist