Settings are now given through TEAMS/settings.json instead of been given through command line arguments
This commit is contained in:
parent
37310e41f5
commit
10fe40e4a8
9 changed files with 209 additions and 69 deletions
|
|
@ -6,13 +6,21 @@ import (
|
|||
"path"
|
||||
)
|
||||
|
||||
var allowRegistration bool = false
|
||||
|
||||
type RegistrationHandler struct {}
|
||||
|
||||
func (e RegistrationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("Handling %s registration request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
if !allowRegistration {
|
||||
log.Printf("UNHANDLED %s registration request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
|
||||
http.Error(w, "{\"errmsg\":\"L'enregistrement d'équipe n'est pas permis.\"}", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("Handling %s registration request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
|
||||
|
||||
// Check request type and size
|
||||
if r.Method != "POST" {
|
||||
http.Error(w, "{\"errmsg\":\"Requête invalide.\"}", http.StatusBadRequest)
|
||||
|
|
|
|||
Reference in a new issue