regarding move  `.strip()` outside the if clause. If I do that, when there is no content-length header, we will call `None.strip()` which would lead to an Exception.

This is the actual reason for the if clause