ensure headers are not sent on HEAD requests after the response has been sent