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 (
|
|||
"strings"
|
||||
)
|
||||
|
||||
var denyNameChange bool = true
|
||||
|
||||
type ChNameHandler struct {}
|
||||
|
||||
func (n ChNameHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("Handling %s name change request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("Handling %s name change 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