getting scheme/protocol of current request
Closed this issue · 2 comments
erjoalgo commented
is it possible to get the scheme used by the current request? I need to generate an oauth redirect uri. So far I've only been able to get the host: (hunchentoot:host)
It looks like there's a related stackoverflow question:
erjoalgo commented
I also tried using (hunchentoot:server-protocol*)
, but it always seems to return HTTP/1.1
even when the request is using https
lemoinem commented
You can use (acceptor-ssl-p acceptor)
in order to know whether the current request is using HTTPS or not.
Once you know this, you should be able to easily generate the complete URL.
Note: (hunchentoot:server-protocol*)
will return the version of the HTTP protocol used, this is independent of whether TLS was used or not.