Set content-length if not set, refs #790