server/receiver/hint.go

20 lines
503 B
Go
Raw Normal View History

2016-12-09 10:55:44 +00:00
package main
import (
"net/http"
2017-11-22 00:52:08 +00:00
"path"
"time"
2016-12-09 10:55:44 +00:00
)
2017-11-22 00:52:08 +00:00
func HintHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
2023-05-12 12:53:15 +00:00
if challengeEnd != nil && time.Now().After(*challengeEnd) {
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard pour un indice !\"}", http.StatusGone)
return
}
2016-12-09 10:55:44 +00:00
// Enqueue file for backend treatment
2017-11-22 00:52:08 +00:00
if saveTeamFile(path.Join(team, "hint"), w, r) {
2016-12-09 10:55:44 +00:00
http.Error(w, "{\"errmsg\":\"Demande d'astuce acceptée...\"}", http.StatusAccepted)
}
}