From 2dfeaae772e630ae361a35bf4680257d081560c1 Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Tue, 30 Jul 2024 01:06:40 +0300 Subject: Подготовка к релизу v1.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/router.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/router.go') diff --git a/app/router.go b/app/router.go index 0dd2f79..33c3189 100644 --- a/app/router.go +++ b/app/router.go @@ -1,7 +1,6 @@ package app import ( - "io" "net/http" u "net/url" "strconv" @@ -44,7 +43,7 @@ func Router() { // функция, что управляет всем handle := func(w http.ResponseWriter, r *http.Request) { - if h := r.Header["Scheme"]; len(h) != 0 && h[0] == "https" { + if h := r.Header["X-Forwarded-Proto"]; len(h) != 0 && h[0] == "https" { Host = h[0] + "://" + r.Host } else { Host = "http://" + r.Host @@ -97,10 +96,14 @@ func Router() { skunky.About() case "stylesheet": w.Header().Add("content-type", "text/css") - io.WriteString(w, Templates["skunky.css"]) + wr(w, Templates["skunky.css"]) + case "favicon.ico": + wr(w, Templates["logo.png"]) } } http.HandleFunc("/", handle) - try_with_exitstatus(http.ListenAndServe(CFG.Listen, nil), 1) + println("SkunkyArt is listening on", CFG.Listen) + + tryWithExitStatus(http.ListenAndServe(CFG.Listen, nil), 1) } -- cgit v1.2.3