Closes #469: make sure the IP sent by the forward proxy is not bigger than 45 chars

This commit is contained in:
bgamard 2020-10-23 19:31:27 +02:00
parent 2a4274d583
commit 7205863d95

View File

@ -366,7 +366,7 @@ public class UserResource extends BaseResource {
AuthenticationToken authenticationToken = new AuthenticationToken()
.setUserId(user.getId())
.setLongLasted(longLasted)
.setIp(ip)
.setIp(StringUtils.abbreviate(ip, 45))
.setUserAgent(StringUtils.abbreviate(request.getHeader("user-agent"), 1000));
String token = authenticationTokenDao.create(authenticationToken);