diff --git a/app/controllers/home.go b/app/controllers/home.go index e9392d5..8373805 100644 --- a/app/controllers/home.go +++ b/app/controllers/home.go @@ -31,6 +31,7 @@ func (c *HomeController) Router(r chi.Router) { func (c *HomeController) Index(w http.ResponseWriter, r *http.Request) { hx := htmx.New(w, r) + isSecure := r.URL.Scheme == "https" if hx.IsHtmxRequest() { hx.PushUrl("/") @@ -40,6 +41,7 @@ func (c *HomeController) Index(w http.ResponseWriter, r *http.Request) { "Version": version.Version, "Build": version.Build, "BinaryVersion": c.ytdl.Version(), + "IsSecure": isSecure, }) } else { app.Views.Render(w, "index", view.Data{ @@ -47,6 +49,7 @@ func (c *HomeController) Index(w http.ResponseWriter, r *http.Request) { "Version": version.Version, "Build": version.Build, "BinaryVersion": c.ytdl.Version(), + "IsSecure": isSecure, }, "layouts/main") } } diff --git a/app/views/index.html b/app/views/index.html index fc57eae..8a9385f 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -27,6 +27,7 @@ required placeholder="Enter url here then click download" /> + {{if .IsSecure}} + {{end}}