normalize username before ratelimiting
This commit is contained in:
parent
043d00395f
commit
0f7b806d99
|
@ -111,7 +111,7 @@ object PasswordHasher {
|
|||
def rateLimit[A: Zero](username: String, req: RequestHeader)(run: RateLimit.Charge => Fu[A]): Fu[A] = {
|
||||
val cost = 1
|
||||
val ip = HTTPRequest lastRemoteAddress req
|
||||
rateLimitPerUser(username, cost = cost) {
|
||||
rateLimitPerUser(User normalize username, cost = cost) {
|
||||
rateLimitPerIP.chargeable(ip, cost = cost) { charge =>
|
||||
rateLimitPerUA(~HTTPRequest.userAgent(req), cost = cost, msg = ip.value) {
|
||||
rateLimitGlobal("-", cost = cost, msg = ip.value) {
|
||||
|
|
Loading…
Reference in a new issue