Retrieve time through X-FIC-Time header instead of time.json

This commit is contained in:
nemunaire 2018-08-17 22:17:51 +02:00 committed by Pierre-Olivier Mercier
parent c33390fa80
commit 6034246015
11 changed files with 107 additions and 131 deletions

View file

@ -6,12 +6,10 @@ import (
"path"
"strconv"
"time"
fronttime "srs.epita.fr/fic-server/frontend/time"
)
func SubmissionHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
if time.Now().Sub(fronttime.ChallengeEnd) > 0 {
if time.Now().Sub(challengeEnd) > 0 {
http.Error(w, "{\"errmsg\":\"Vous ne pouvez plus soumettre, le challenge est terminé.\"}", http.StatusForbidden)
return
}