feat: read env for TLS to set schemas for assets/css
This commit is contained in:
parent
bcd8c1333d
commit
857c4ed001
9
main.go
9
main.go
@ -5,6 +5,7 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -94,6 +95,12 @@ type Context struct {
|
||||
}
|
||||
|
||||
func NewContext(r *http.Request) *Context {
|
||||
isTLS := false
|
||||
tls := os.Getenv("TLS")
|
||||
if tls != "" {
|
||||
isTLS = true
|
||||
}
|
||||
|
||||
return &Context{
|
||||
request: r,
|
||||
StatusCode: 200,
|
||||
@ -105,7 +112,7 @@ func NewContext(r *http.Request) *Context {
|
||||
},
|
||||
},
|
||||
AppURL: r.Host,
|
||||
IsTLS: false,
|
||||
IsTLS: isTLS,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user