Use URL.ParseStrategy instead of WebURL when deployment target is bumped to iOS 16 #170

Open
opened 2022-07-09 15:45:15 +00:00 by shadowfacts · 0 comments
Owner
let strategy = URL.ParseStrategy()
    .scheme(.defaultValue("https"))
    .user(.optional)
    .password(.optional)
    .host(.required)
    .port(.optional)
    .path(.optional)
    .query(.optional)
    .fragment(.optional)
let text = "www.watermelon.com/about"
let url = try? strategy.parse(text) // https://www.watermelon.com/about
try? URL.ParseStrategy().parse("http://見.香港/热狗/🌭")

should return
http://xn--nw2a.xn--j6w193g/%E7%83%AD%E7%8B%97/%F0%9F%8C%AD

Originally posted by @shadowfacts in #163 (comment)

``` let strategy = URL.ParseStrategy() .scheme(.defaultValue("https")) .user(.optional) .password(.optional) .host(.required) .port(.optional) .path(.optional) .query(.optional) .fragment(.optional) let text = "www.watermelon.com/about" let url = try? strategy.parse(text) // https://www.watermelon.com/about ``` ``` try? URL.ParseStrategy().parse("http://見.香港/热狗/🌭") ``` should return `http://xn--nw2a.xn--j6w193g/%E7%83%AD%E7%8B%97/%F0%9F%8C%AD` _Originally posted by @shadowfacts in https://git.shadowfacts.net/shadowfacts/Tusker/issues/163#issuecomment-586_
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: shadowfacts/Tusker#170
No description provided.