in reply to Content-Type: text/html
I think this would also happen if there is a blank line (rather, any content at all) going to the client before the header is sent.