Skip to content

Commit ad62422

Browse files
committed
Fix regex for steam id detection
1 parent 1386c0f commit ad62422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handlers/users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func GetUser(c *gin.Context) *APIError {
4848

4949
if err == nil && value <= math.MaxInt32 {
5050
user, dbError = db.GetUserById(value)
51-
} else if regexp.MustCompile(`\d`).MatchString(query) {
51+
} else if regexp.MustCompile(`^\d+$`).MatchString(query) {
5252
user, dbError = db.GetUserBySteamId(query)
5353
} else {
5454
user, dbError = db.GetUserByUsername(query)

0 commit comments

Comments
 (0)