Go back to using WebURL for everything #163

Closed
opened 2022-05-17 20:34:53 +00:00 by shadowfacts · 1 comment
Owner
Once WebURL supports IDNA: https://github.com/karwa/swift-url/issues/147
shadowfacts added the
external
label 2022-05-17 20:34:53 +00:00
Author
Owner

And use URL.ParseStrategy on iOS 16

let strategy = URL.ParseStrategy()
    .scheme(.defaultValue("https"))
    .user(.optional)
    .password(.optional)
    .host(.required)
    .port(.defaultValue(8080))
    .path(.optional)
    .query(.optional)
    .fragment(.optional)
let text = "www.watermelon.com/about"
let url = try? strategy.parse(text) // https://www.watermelon.com:8080/about
try? URL.ParseStrategy().parse("http://見.香港/热狗/🌭")

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

And use URL.ParseStrategy on iOS 16 ``` let strategy = URL.ParseStrategy() .scheme(.defaultValue("https")) .user(.optional) .password(.optional) .host(.required) .port(.defaultValue(8080)) .path(.optional) .query(.optional) .fragment(.optional) let text = "www.watermelon.com/about" let url = try? strategy.parse(text) // https://www.watermelon.com:8080/about ``` ``` try? URL.ParseStrategy().parse("http://見.香港/热狗/🌭") ``` should return `http://xn--nw2a.xn--j6w193g/%E7%83%AD%E7%8B%97/%F0%9F%8C%AD`
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#163
No description provided.