m

    Marc Knaup

    3 years ago
    What about moving
    Url
    from ktor.http to stdlib? 🤔 • it's very commonly needed • it's for more than HTTP or even networking • Ktor is an implementation detail - could also be another HTTP client • when using different libraries (networking and other) they all use different
    Url
    classes because there's no common denominator
    natpryce

    natpryce

    3 years ago
    A URI class would be very useful, even for developers on the JVM (neither the the standard URL nor URI class implement encoding of paths correctly)
    elizarov

    elizarov

    3 years ago
    The problem is that standards on what “proper encoding” and what is a “correct URL/URI” change from time to time. Adding these kind of things to stdlib in not the best idea.
    Also, you’d want this class to be useful in practical situations, which is often in opposition to being “standards compliant”, and there you have too much domain-specific design freedom.
    natpryce

    natpryce

    3 years ago
    Hmmm... the URI class gets path encoding/decoding wrong and therefore cannot be used with real services that are out there on the web. Encoding/decoding of hierarchical URI paths was specified in the late ‘90s
    elizarov

    elizarov

    3 years ago
    so what class that does it right you use?
    Also when you talk about “using in real services”, then what kind of use-cases you have in mind? What you should be able to do with them? (Note that we are talking about stdlib, not ktor here).
    natpryce

    natpryce

    3 years ago
    There are a few UrlBuilder / UriBuilder classes I’ve used. As long as you use them to build string representations of the URI and never pass them to the standard URI and URL classes you can get away with it
    There’s one called UriNE 🙄
    And on the parsing side, HTTP4k parses incoming URIs correctly. (Undertow did not when I last looked at it, for example)
    n

    nkiesel

    3 years ago
    I only found https://sourceforge.net/projects/urin/ but not "UriNE". Is that the one you were talking about? And what are examples of wrong encodings in the URI class?