Skip to content

Commit

Permalink
limit the max size of a single field of a profile; solving #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimahmed443 committed Jan 18, 2015
1 parent f53ed23 commit 1ea28b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blockstack_registrar/blockdata/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def splitter(remaining,username):
return remaining, None
else:
for key in remaining.keys():
if utf8len(json.dumps(remaining[key])) > max_size(username):
remaining[key] = remaining[key][:max_size(username) - 12]

split[key] = remaining[key]

if utf8len(json.dumps(split)) < max_size(username):
Expand All @@ -150,7 +153,7 @@ def get_key(key_counter):
split, remaining = splitter(profile, username)
values.append(split)

key_counter = 0
key_counter = 000000
counter = 0

while(remaining is not None):
Expand Down

0 comments on commit 1ea28b8

Please sign in to comment.