limit request length to 512k
python3 compatibility, closes #14