Closed trapias closed 6 years ago
The TLS field will never be set on OpenShift - you can check the HTTP header X-Forwarded-Proto
to determine if the request is sent over a secure connection:
func handle(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("X-Forwarded-Proto") == "https" {
...
Hello, I'm successfully testing this gear, binding just like the sample with
I see my webapp responds both on HTTP and HTTPS this way. Is it possible for me to understand, in my handlers, if the request comes over the one or the other?
I tried monitoring http.Request.TLS, but it's always nil - also for HTTPS requests. I don't think that's because I'm using a free gear, with a shared certificate, is it?
Thanks for any help, al.