Http.request.protocol

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Http.request.protocol

Hugo <Nabble>
I tried Http.request.protocol but this doesn't work. In java I use "request.getProtocol()". How can I get the current protocol of the page?
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

Hugo <Nabble>
I just want to remember that it is possible to get the protocol from Http.request.url, but this needs processing. Ideally the request should have that information as a property.
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

fschmidt
Administrator
done in rev 44caaa6a3d92
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

Hugo <Nabble>
Thanks. Please assign this back to me when we can release luanhost.
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

fschmidt
Administrator
released
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

Hugo <Nabble>
I just realized that the protocol in the java servlet isn't reliable, see:
http://stackoverflow.com/questions/8200853/how-can-i-know-if-the-request-to-the-servlet-was-executed-using-http-or-https

It shows HTTP/1.1 in both cases (HTTP and HTTPS). The right approach is the isSecure() method as explained in the thread above.
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

fschmidt
Administrator
Can I use getScheme instead?
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

Hugo <Nabble>
I just tested the getScheme() method and it seems to work fine. I think it would be worth using the isSecure() method as well and have both properties available:

Http.request.scheme
Http.request.is_secure

This would make things consistent with the servlets API.
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

fschmidt
Administrator
done in rev b92fc7ec7f51.  Let me know when you want me to release it.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: Http.request.protocol

Hugo <Nabble>
You've released it and everything works fine now. Thanks.

I am closing this thread.