removed rateLimit from http router requests

improved logging
This commit is contained in:
2021-10-20 00:11:42 +02:00
parent 6e951183de
commit df33974b49
12 changed files with 49 additions and 2752 deletions

16
main.go
View File

@@ -147,7 +147,7 @@ func housekeeping() {
func getPlayer(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", conf.Httpd.CORSAllowDomains)
id := mux.Vars(r)["id"]
tPlayer, err := utils.GetPlayer(db, id, conf.Steam.APIKey, rL)
tPlayer, err := utils.GetPlayer(db, id, conf.Steam.APIKey, nil)
if err != nil {
log.Infof("[GP] Player not found: %+v", err)
w.WriteHeader(http.StatusNotFound)
@@ -301,14 +301,14 @@ func deletePlayerTrack(w http.ResponseWriter, r *http.Request) {
return
}
tPlayer, err := utils.GetPlayer(db, id, conf.Steam.APIKey, rL)
tPlayer, err := utils.GetPlayer(db, id, conf.Steam.APIKey, nil)
if err != nil {
log.Infof("[PPT] player not found: %+v", err)
w.WriteHeader(http.StatusNotFound)
return
}
_, err = utils.IsAuthCodeValid(tPlayer, db.Lock, conf.Steam.APIKey, "", authCode, rL)
_, err = utils.IsAuthCodeValid(tPlayer, db.Lock, conf.Steam.APIKey, "", authCode, nil)
if err != nil {
switch e := err.(type) {
case utils.AuthcodeUnauthorizedError:
@@ -617,16 +617,6 @@ func getMatch(w http.ResponseWriter, r *http.Request) {
Decoy: iStats.UdDecoy,
Flames: iStats.UdFlames,
},
HitGroup: &utils.HitGroup{
Gear: iStats.HitGroupGear,
LeftLeg: iStats.HitGroupLeftLeg,
RightLeg: iStats.HitGroupRightLeg,
RightArm: iStats.HitGroupRightArm,
LeftArm: iStats.HitGroupLeftArm,
Stomach: iStats.HitGroupStomach,
Chest: iStats.HitGroupChest,
Head: iStats.HitGroupHead,
},
},
Color: iStats.Color.String(),
Crosshair: iStats.Crosshair,