Content length fixes

Partially resolves #137 

This PR uses ``Content-Length`` header value instead of unreliable ``res.bodySize`` field.