Fix bug when submitting an invalid content

length constrains
flush by code itself instead of the container