I have implemented gziping content of response in a filter. If server is sending 200 response without any content is still adding content encoding header like
Content-Encoding:gzip
Content-Length:0
On the other side another filter is reading the response and is trying to create GZIPInputStream which will fail because content does not contain gzip header and footer. Question is which side is doing it wrong? Should producer not add "Content-Encoding:gzip"? Should producer add gzip header/footer to content? Or maybe should consumer recognize empty content and don't try to create GZIPInputStream? Browsers not have any problem with consuming such responses.
I didn't try this special case but I think the producer side is ok because the response does not have content so Content-Length:0 is ok. But the consumer side is not ok when it try to create GZIPInputStream with nil content.