Giter Site home page Giter Site logo

Brainstorm Uri Representation about hyper HOT 9 CLOSED

hyperium avatar hyperium commented on April 29, 2024
Brainstorm Uri Representation

from hyper.

Comments (9)

seanmonstar avatar seanmonstar commented on April 29, 2024

As the docs for variants point out, a target server should only need the
AbsolutePath. The others are used mostly by proxies.
http://seanmonstar.github.io/hyper/hyper/uri/type.RequestUri.html
On Sep 17, 2014 12:19 AM, "Jonathan Reem" [email protected] wrote:

I've found the current version unergonomic to work with in downstream
libraries without just ignoring certain variants. Not sure right now what's
better, but I'll think about it.

β€”
Reply to this email directly or view it on GitHub
#39.

from hyper.

reem avatar reem commented on April 29, 2024

That's what we do in Iron. I guess that's really the best we can do.

from hyper.

seanmonstar avatar seanmonstar commented on April 29, 2024

Though, we could add some convenience methods to get to the path.

Also, I've been thing that it might be cool to have a stronger typed value
than just a String in there...
On Sep 17, 2014 2:53 PM, "Jonathan Reem" [email protected] wrote:

That's what we do in Iron. I guess that's really the best we can do.

β€”
Reply to this email directly or view it on GitHub
#39 (comment).

from hyper.

reem avatar reem commented on April 29, 2024

We should probably use rust-url and hold a Url value instead of a String.

from hyper.

reem avatar reem commented on April 29, 2024

The tricky thing is that rust-url does not support parsing from only a relative url - you have to give it a full absolute path.

We have a huge hack in Iron where we construct a url for rust-url to parse, but I think that won't be necessary if we have all the info inside hyper.

from hyper.

seanmonstar avatar seanmonstar commented on April 29, 2024

Yea I wanted to use a Path from rust-url, but there isn't one yet. I tried
asking for one in servo/rust-url#14, but since I
could only offer hypotheticals, it was closed. Maybe you could give
concrete needs for Iron.

from hyper.

reem avatar reem commented on April 29, 2024

It looks like it was closed with a fix, does the method he added not do what we want?

from hyper.

seanmonstar avatar seanmonstar commented on April 29, 2024

I guess I missed that. I'd need to look into it. It looks like it validates that the value is a proper path, but otherwise returns a String.

Would it be doing too much if hyper transformed a Path + Query into something, or perhaps having a Decodable fn for getting a query? Perhaps that's better left to library land.

from hyper.

reem avatar reem commented on April 29, 2024

I think it's fair if Hyper provides a typed representation for request-line, with precedent being typed headers and other such things. We should just make sure to not lose any information.

from hyper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.