set content-length for errors, too