This commit is contained in:
nemunaire 2021-02-13 18:34:44 +01:00
parent 331192ccbe
commit 2f4cc04db2
7 changed files with 30 additions and 29 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"strings" "strings"
"time" "time"
gc "github.com/rthornton128/goncurses" gc "github.com/rthornton128/goncurses"
) )

View File

@ -27,7 +27,6 @@ type loginUpload struct {
Password string Password string
} }
func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if addr := r.Header.Get("X-Forwarded-For"); addr != "" { if addr := r.Header.Get("X-Forwarded-For"); addr != "" {
r.RemoteAddr = addr r.RemoteAddr = addr

View File

@ -105,7 +105,8 @@ func main() {
log.Println(fmt.Sprintf("Ready, listening on %s", *bind)) log.Println(fmt.Sprintf("Ready, listening on %s", *bind))
// Wait shutdown signal // Wait shutdown signal
mloop: for { mloop:
for {
switch <-interrupt { switch <-interrupt {
case syscall.SIGHUP: case syscall.SIGHUP:
log.Println("Reloading students files...") log.Println("Reloading students files...")
@ -113,7 +114,7 @@ func main() {
log.Println("Error during students.csv reload:", err) log.Println("Error during students.csv reload:", err)
} }
case syscall.SIGTERM, syscall.SIGINT: case syscall.SIGTERM, syscall.SIGINT:
break mloop; break mloop
} }
} }