Skip to content

Commit

Permalink
fixed stupidity
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelcmtd committed Jul 10, 2020
1 parent 48ba80f commit ea78678
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 2 additions & 6 deletions redirector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<html>")
fmt.Fprintf(w, "<head>")
fmt.Fprintf(w, "<title>Redirecting...</title>")
Expand All @@ -21,8 +19,6 @@ func main() {
fmt.Fprintf(w, "</head>")
fmt.Fprintf(w, "<body>")
fmt.Fprintf(w, "Just switch to https up there ↑")
fmt.Fprintf(w, "<br/>")
fmt.Fprintf(w, "Or click <a href='%s'>here</a>", url)
fmt.Fprintf(w, "</body>")
fmt.Fprintf(w, "</html>")
})
Expand Down

0 comments on commit ea78678

Please sign in to comment.