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"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -94,6 +95,12 @@ type Context struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewContext(r *http.Request) *Context {
|
func NewContext(r *http.Request) *Context {
|
||||||
|
isTLS := false
|
||||||
|
tls := os.Getenv("TLS")
|
||||||
|
if tls != "" {
|
||||||
|
isTLS = true
|
||||||
|
}
|
||||||
|
|
||||||
return &Context{
|
return &Context{
|
||||||
request: r,
|
request: r,
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
@ -105,7 +112,7 @@ func NewContext(r *http.Request) *Context {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
AppURL: r.Host,
|
AppURL: r.Host,
|
||||||
IsTLS: false,
|
IsTLS: isTLS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user