server/frontend/hint.go

20 lines
481 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) {
if time.Now().Sub(challengeEnd) > 0 {
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)
}
}