component/web: Add 'HTTPSMETHOD'

This commit sets the 'HTTPSMETHOD' variable on the 'web' component for
when https is or is not enabled.
This commit is contained in:
Tom Wiesing 2022-09-11 13:04:15 +02:00
parent e1ee569629
commit 2ee90bf462
No known key found for this signature in database
4 changed files with 11 additions and 3 deletions

View file

@ -17,9 +17,15 @@ func (WebComponent) Name() string {
}
func (web WebComponent) Stack() stack.Installable {
HTTPS_METHOD := "nohttp"
if web.dis.HTTPSEnabled() {
HTTPS_METHOD = "redirect"
}
return web.dis.makeComponentStack(web, stack.Installable{
EnvContext: map[string]string{
"DEFAULT_HOST": web.dis.Config.DefaultDomain,
"HTTPS_METHOD": HTTPS_METHOD,
},
})
}