normalize usernames in crosstable API - fixes #7354
parent
5bb0cf1c89
commit
c25df35b77
|
@ -175,9 +175,11 @@ final class Api(
|
|||
key = "crosstable.api.ip"
|
||||
)
|
||||
|
||||
def crosstable(u1: String, u2: String) =
|
||||
def crosstable(name1: String, name2: String) =
|
||||
ApiRequest { req =>
|
||||
CrosstableRateLimitPerIP(HTTPRequest lastRemoteAddress req, cost = 1) {
|
||||
import lila.user.User.normalize
|
||||
val (u1, u2) = (normalize(name1), normalize(name2))
|
||||
env.game.crosstableApi.fetchOrEmpty(u1, u2) flatMap { ct =>
|
||||
(ct.results.nonEmpty && getBool("matchup", req)).?? {
|
||||
env.game.crosstableApi.getMatchup(u1, u2)
|
||||
|
|
Loading…
Reference in New Issue