server/receiver/choices.go

20 lines
498 B
Go
Raw Normal View History

2018-12-02 22:18:32 +00:00
package main
import (
"net/http"
"path"
"time"
)
func WantChoicesHandler(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) {
2018-12-02 22:18:32 +00:00
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard !\"}", http.StatusGone)
return
}
// Enqueue file for backend treatment
if saveTeamFile(path.Join(team, "choices"), w, r) {
http.Error(w, "{\"errmsg\":\"Demande de choix acceptée...\"}", http.StatusAccepted)
}
}