frontend: Fix issue with redirecting URL for chname and issue
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2021-07-22 11:27:29 +02:00
parent 29607981e4
commit d701331436
3 changed files with 2 additions and 6 deletions

View File

@ -12,8 +12,6 @@ func ChNameHandler(w http.ResponseWriter, r *http.Request, team string, sURL []s
if denyNameChange {
log.Printf("UNHANDELED %s name change request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
http.Error(w, "{\"errmsg\":\"Le changement de nom est prohibé.\"}", http.StatusForbidden)
} else if len(sURL) != 0 {
http.Error(w, "{\"errmsg\":\"Arguments manquants.\"}", http.StatusBadRequest)
} else if saveTeamFile(path.Join(team, "name"), w, r) {
// File enqueued for backend treatment
http.Error(w, "{\"errmsg\":\"Demande de changement de nom acceptée\"}", http.StatusAccepted)

View File

@ -12,8 +12,6 @@ func IssueHandler(w http.ResponseWriter, r *http.Request, team string, sURL []st
if !acceptNewIssues {
log.Printf("UNHANDELED %s issue request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
http.Error(w, "{\"errmsg\":\"Il n'est pas possible de rapporter d'anomalie.\"}", http.StatusForbidden)
} else if len(sURL) != 0 {
http.Error(w, "{\"errmsg\":\"Arguments manquants.\"}", http.StatusBadRequest)
} else if saveTeamFile(path.Join(team, "issue"), w, r) {
// File enqueued for backend treatment
http.Error(w, "{\"errmsg\":\"Anomalie signalée avec succès. Merci de votre patience...\"}", http.StatusAccepted)

View File

@ -54,8 +54,8 @@ func main() {
settings.LoadAndWatchSettings(path.Join(settings.SettingsDir, settings.SettingsFile), reloadSettings)
// Register handlers
http.Handle(fmt.Sprintf("%s/chname/", *prefix), http.StripPrefix(fmt.Sprintf("%s/chname/", *prefix), submissionTeamChecker{"name change", ChNameHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/issue/", *prefix), http.StripPrefix(fmt.Sprintf("%s/issue/", *prefix), submissionTeamChecker{"issue", IssueHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/chname", *prefix), http.StripPrefix(fmt.Sprintf("%s/chname", *prefix), submissionTeamChecker{"name change", ChNameHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/issue", *prefix), http.StripPrefix(fmt.Sprintf("%s/issue", *prefix), submissionTeamChecker{"issue", IssueHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/openhint/", *prefix), http.StripPrefix(fmt.Sprintf("%s/openhint/", *prefix), submissionTeamChecker{"opening hint", HintHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/wantchoices/", *prefix), http.StripPrefix(fmt.Sprintf("%s/wantchoices/", *prefix), submissionTeamChecker{"wantint choices", WantChoicesHandler, *teamsDir, *simulator}))
http.Handle(fmt.Sprintf("%s/registration", *prefix), http.StripPrefix(fmt.Sprintf("%s/registration", *prefix), submissionChecker{"registration", RegistrationHandler}))