From 9367e727e43e6b0f1c55a07fb10c0d9bb6197684 Mon Sep 17 00:00:00 2001 From: sahandevs Date: Mon, 16 May 2022 17:26:43 +0430 Subject: [PATCH] check if accept encoding is not empty --- filter/ngx_http_brotli_filter_module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filter/ngx_http_brotli_filter_module.c b/filter/ngx_http_brotli_filter_module.c index 592b767..4d85364 100644 --- a/filter/ngx_http_brotli_filter_module.c +++ b/filter/ngx_http_brotli_filter_module.c @@ -213,6 +213,8 @@ static ngx_int_t check_accept_encoding(ngx_http_request_t* req) { if (accept_encoding_entry == NULL) return NGX_DECLINED; accept_encoding = &accept_encoding_entry->value; + if (accept_encoding->len < kEncodingLen) return NGX_DECLINED; + cursor = accept_encoding->data; end = cursor + accept_encoding->len; while (1) {