test for content-length setting and fix for unset content lengths