The problem is that I wasn't understanding that your code already handled the case of:

    Content-Encoding: gzip
    Content-Encoding: deflate

because it lets field_count persist.  Now that I understand I don't feel strongly about edcf956, but some comments would be really helpful.