return 400 if player without matches tries to track himself without providing a valid sharecode
This commit is contained in:
4
main.go
4
main.go
@@ -522,6 +522,10 @@ func postPlayerTrack(w http.ResponseWriter, r *http.Request) {
|
|||||||
log.Infof("[PPT] shareCode provided for player %s is invalid: %v", id, e)
|
log.Infof("[PPT] shareCode provided for player %s is invalid: %v", id, e)
|
||||||
w.WriteHeader(http.StatusPreconditionFailed)
|
w.WriteHeader(http.StatusPreconditionFailed)
|
||||||
return
|
return
|
||||||
|
case *ent.NotFoundError:
|
||||||
|
log.Infof("[PPT] match not found for player %+v: %+v, %+v", id, authCode, shareCode)
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
default:
|
default:
|
||||||
log.Infof("[PPT] Temporary Steam-API problem: %v", e)
|
log.Infof("[PPT] Temporary Steam-API problem: %v", e)
|
||||||
w.WriteHeader(http.StatusServiceUnavailable)
|
w.WriteHeader(http.StatusServiceUnavailable)
|
||||||
|
Reference in New Issue
Block a user