From ea7867818d1e75d843e52ff428c5170af5061145 Mon Sep 17 00:00:00 2001 From: chrissx Date: Fri, 10 Jul 2020 23:07:33 +0200 Subject: [PATCH] fixed stupidity --- install.sh | 2 +- redirector.go | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 76521d4..402d740 100644 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -curl -Lo /usr/bin/redirector https://github.com/chrissxYT/chrissx.de-80/releases/download/2.0/redirector-arm +curl -Lo /usr/bin/redirector https://github.com/chrissxYT/chrissx.de-80/releases/download/2.1/redirector-arm chmod +x /usr/bin/redirector echo "[Unit] diff --git a/redirector.go b/redirector.go index d8514b9..11ee2c0 100644 --- a/redirector.go +++ b/redirector.go @@ -8,10 +8,8 @@ import ( func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - log.Printf("Got an %s request from %s: %s", - r.Proto, r.RemoteAddr, r.URL) - url := r.URL - url.Scheme = "https" + log.Printf("Got an %s request from %s: %s (%s)", + r.Proto, r.RemoteAddr, r.URL, r.Host) fmt.Fprintf(w, "") fmt.Fprintf(w, "") fmt.Fprintf(w, "Redirecting...") @@ -21,8 +19,6 @@ func main() { fmt.Fprintf(w, "") fmt.Fprintf(w, "") fmt.Fprintf(w, "Just switch to https up there ↑") - fmt.Fprintf(w, "
") - fmt.Fprintf(w, "Or click here", url) fmt.Fprintf(w, "") fmt.Fprintf(w, "") })