Ok, so it seems my issue was that I didn’t update content length to be length oof compressed data and instead I was using length of uncompressed string.
Ok, so it seems my issue was that I didn’t update content length to be length oof compressed data and instead I was using length of uncompressed string.