mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Limit the length of the values logged into the database. Refs #73
This commit is contained in:
parent
22a7d7e160
commit
4daba3daa3
1 changed files with 3 additions and 1 deletions
|
|
@ -85,11 +85,13 @@ def query2str(items):
|
|||
|
||||
If there's a field called "password" it will be excluded from the output.
|
||||
"""
|
||||
# Limit the length of the value to avoid a DoS attack
|
||||
value_maxlimit = 256
|
||||
|
||||
kvs = []
|
||||
for k, v in items:
|
||||
if k != 'password':
|
||||
kvs.append(six.u('%s=%s') % (k, v))
|
||||
kvs.append(six.u('%s=%s') % (k, v[:256]))
|
||||
|
||||
return '\n'.join(kvs)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue