Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iron Request is missing/losing hyper Ssl #425

Open
MarkSwanson opened this issue Feb 11, 2016 · 6 comments
Open

Iron Request is missing/losing hyper Ssl #425

MarkSwanson opened this issue Feb 11, 2016 · 6 comments

Comments

@MarkSwanson
Copy link

Hello,

My Iron handler must have access to hyper Request.Ssl.
I note that when Iron constructs its own Request struct that it forgets to also grab Ssl.
Is this on purpose (perhaps out of scope for Iron atm)?

(Iron src/request/mod.rs)

    pub fn from_http(req: HttpRequest<'a, 'b>, local_addr: SocketAddr, protocol: &Protocol)
                     -> Result<Request<'a, 'b>, String> {
        let (addr, method, headers, uri, _, reader) = req.deconstruct();

...

        Ok(Request {
            url: url,
            remote_addr: addr,
            local_addr: local_addr,
            headers: headers,
            body: Body::new(reader),
            method: method,
            extensions: TypeMap::new()
        })

Thanks!

@untitaker
Copy link
Member

What information in particular do you want from Hyper's datastructures?

@sfackler
Copy link
Contributor

sfackler commented Jan 8, 2017

@untitaker I believe the request is for a method that forwards to Request::downcast_ref: https://docs.rs/hyper/0.9.14/hyper/server/request/struct.Request.html#method.downcast_ref

@frjonsen
Copy link

I suspect this bug is due to this: https://github.com/iron/iron/blob/master/src/iron.rs#L137

When constructing a https server, Protocol::http() is used. This makes things like the iron-routers url_for! not work properly, because it constructs a http:// url even when using https.

@untitaker
Copy link
Member

@frjonsen I think your bug is valid but not related to this issue

@frjonsen
Copy link

Ah, yes, I see now I went through the issue a bit quickly, as it seemed similar enough to the issue I was having. Sorry about that.

@untitaker
Copy link
Member

untitaker commented Mar 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants