Do I assume correctly that Ktor's `Url` is only to...
# ktor
m
Do I assume correctly that Ktor's
Url
is only to be used for HTTP-based URLs? It messes up URLs with other schemes like
file
or
custom
. (It should probably be called
HttpUrl
in that case 🤔)
e
Hi @Marc Knaup, it’s not specific to http 🙂. The protocol part of url(
URLProtocol
) is data class with a public constructor.
m
So the following two examples would be considered a bug then?
Copy code
Url("<mailto:marc@knaup.io>").toString() // "<mailto://localhost/marc@knaup.io>"
Url("file:///var/www").toString() // "<file://var/www>"
e
Yep, it looks like the bug in parser. Btw it should be possible to create url with a custom protocol with the default constructor.
m
Alright, thanks you 🙂 I'll file a bug.
e
Awesome, thanks 🙂 We also accept PRs 😉
😁 1
m