Closed svetlyak40wt closed 5 years ago
Since Clack aims to be a thin HTTP abstraction layer, I'm not sure the special logic should be implemented in Clack. Clack's ENV represents HTTP parameters like Apache's or nginx's, so it could be considered if those web servers' REQUEST_SCHEME is affected by the HTTP header X-Forward-Proto. (I don't have enough time to google for now, though)
Additinally, it's troublesome to add such a logic to every Clack handlers.
Lack.Request may have a function to tell whether the request is over SSL or not, like request-ssl-p
, if it works for your purpose.
The problem I'm trying to solve is that request-uri-scheme
returns wrong scheme – http
, when my common lisp process is behind a reverse proxy. request-host
returns correct data but request-uri-scheme isn't.
I'm using this data to build a full site's url to use it as a webhook address or in a emails.
If you think, it is wrong to fix this in the Lack, I'll accept it and will fix this behaviour at the Weblock code, here:
P.S. – not sure if request-ssl-p
is needed.
I've made this feature in the Weblocks:
The
X-Forwarded-Proto
header is a de-facto standard header for identifying the protocol (HTTP or HTTPS) that a client used to connect to your proxy or load balancer.More details on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
Pull https://github.com/fukamachi/woo/pull/79 depends on a test from this pull.