Skip to content

Commit

Permalink
remove old mobile UA regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jul 19, 2023
1 parent 094409c commit 07a9fcd
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions modules/security/src/main/Mobile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ object Mobile:
)

object LichessMobileUa:
private val RegexOld =
"""(?i)lichess mobile/(\S+) \((\d*)\) as:(\S+) os:(Android|iOS)/(\S+) dev:(.*)""".r // remove soon
private val Regex =
"""(?i)lichess mobile/(\S+) \((\d*)\) as:(\S+) sri:(\S+) os:(Android|iOS)/(\S+) dev:(.*)""".r
def parse(req: RequestHeader): Option[LichessMobileUa] = HTTPRequest.userAgent(req) flatMap parse
Expand All @@ -54,9 +52,6 @@ object Mobile:
case Regex(version, build, user, sri, osName, osVersion, device) =>
val userId = (user != "anon") option UserStr(user).id
LichessMobileUa(version, ~build.toIntOption, userId, Sri(sri), osName, osVersion, device).some
case RegexOld(version, build, user, osName, osVersion, device) =>
val userId = (user != "anon") option UserStr(user).id
LichessMobileUa(version, ~build.toIntOption, userId, Sri("old"), osName, osVersion, device).some
case _ => none

// LM/{version} {android|ios}/{os-version} {device info}
Expand Down

0 comments on commit 07a9fcd

Please sign in to comment.