Closed ChristophP closed 6 years ago
This library is not released yet.
Also, this library is primarily for handling the browser address line where the protocol will always be a kind of HTTP as far as I know. I've never heard of a website being at a websocket, for example.
If someone needs different URLs they can make a different library for now. We can expand later.
Since the library uses a protocol type, defined like this:
it is possible to use the library for anything other than http and https. But what about if somebody needs a websocket url? The schemes
... | Ws | Wss
would have to be added to support that (which I would argue is the most common scheme in the web after http). But maybe there are also other cases not covered by this, so having... | Other String
might be a good idea too. It would be a shame if people coulnd't use this nice library because their scheme is not supported.Also
toUrl
has a check forhttp
orhttps
hardcoded which makes it impossible for other schemes to be aURL
. My personal opinion is that this library should be not make any assumptions on the scheme which is used and just treat it as the part before the:
and//
.