tokers / zstd-nginx-module

Nginx modules for the Zstandard compression
BSD 2-Clause "Simplified" License
196 stars 23 forks source link

bugfix: fix zstd module infinite loop when upstream return content-length abnormal #23

Open drawing opened 1 year ago

drawing commented 1 year ago

When the backend business returns a content-length exception, which the content-length is greater than the actual body size(for example, restart when the business return data is not completed), nginx will send a flush empty buffer, which will cause an infinite loop of zstd filter module.

for example, upstream return content:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2

a
ThinkChaos commented 6 months ago

Ran into this bug and can confirm this fix worked!

Would be nice to get it merged to save time for others :)

melroy89 commented 3 weeks ago

Somebody merge it?