mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
Don't try to compress empty responses.
This commit is contained in:
@@ -23,6 +23,11 @@ static int transform_gzip(struct wsgi_request *wsgi_req, struct uwsgi_transforma
|
||||
struct uwsgi_transformation_gzip *utgz = (struct uwsgi_transformation_gzip *) ut->data;
|
||||
struct uwsgi_buffer *ub = ut->chunk;
|
||||
|
||||
if (ub->pos == 0) {
|
||||
// Don't try to compress empty responses.
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ut->is_final) {
|
||||
if (uwsgi_gzip_fix(&utgz->z, utgz->crc32, ub, utgz->len)) {
|
||||
free(utgz);
|
||||
|
||||
Reference in New Issue
Block a user