Browse Source

forbid empty querying scores

master
Morgan Bazalgette 10 months ago
parent
commit
50ffa4e066
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      app/v1/score.go

+ 3
- 0
app/v1/score.go View File

@@ -76,6 +76,9 @@ func ScoresGET(md common.MethodData) common.CodeMessager {
76 76
 		Table:   "scores",
77 77
 		Allowed: []string{"pp", "score", "accuracy", "id"},
78 78
 	})
79
+	if where.Clause == "" {
80
+		return ErrMissingField("must specify at least one queried item")
81
+	}
79 82
 
80 83
 	where.Where(` scores.completed = '3' AND `+md.User.OnlyUserPublic(false)+` `+
81 84
 		genModeClause(md)+` `+sort+common.Paginate(md.Query("p"), md.Query("l"), 100), "FIF")

Loading…
Cancel
Save