Rename frontend as receiver

This commit is contained in:
nemunaire 2023-07-09 20:40:53 +02:00
parent dc83efa868
commit 1ca5452707
111 changed files with 79 additions and 81 deletions

19
receiver/hint.go Normal file
View file

@ -0,0 +1,19 @@
package main
import (
"net/http"
"path"
"time"
)
func HintHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
if challengeEnd != nil && time.Now().After(*challengeEnd) {
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard pour un indice !\"}", http.StatusGone)
return
}
// Enqueue file for backend treatment
if saveTeamFile(path.Join(team, "hint"), w, r) {
http.Error(w, "{\"errmsg\":\"Demande d'astuce acceptée...\"}", http.StatusAccepted)
}
}