diff options
| author | lost+skunk <[email protected]> | 2024-07-30 01:06:40 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-07-30 01:06:40 +0300 |
| commit | 2dfeaae772e630ae361a35bf4680257d081560c1 (patch) | |
| tree | b3af5d798430d36c2a362b9be250fb7fcdb353ad /app/router.go | |
| parent | e02174cb710e6d6abd642f03e64ce91bbac38130 (diff) | |
| download | skunky-art-2dfeaae772e630ae361a35bf4680257d081560c1.tar.gz skunky-art-2dfeaae772e630ae361a35bf4680257d081560c1.tar.bz2 skunky-art-2dfeaae772e630ae361a35bf4680257d081560c1.zip | |
Подготовка к релизу v1.3.1
Diffstat (limited to 'app/router.go')
| -rw-r--r-- | app/router.go | 11 |
1 files changed, 7 insertions, 4 deletions
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) } |
