-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Description
cannot match zstd when accept-encoding is gzip,zstd,br.
static ngx_int_t
ngx_http_zstd_accept_encoding(ngx_str_t *ae)
{
u_char *p;
p = ngx_strcasestrn(ae->data, "zstd", sizeof("zstd") - 1);
if (p == NULL) {
return NGX_DECLINED;
}
if (p == ae->data || (*(p - 1) == ',' || *(p - 1) == ' ')) {
p += sizeof("zstd") - 1;
if (p == ae->data + ae->len || *p == ',' || *p == ' ' || *p == ';') {
return NGX_OK;
}
}
return NGX_DECLINED;
}
u_char * ngx_strcasestrn(u_char *s1, char *s2, size_t n)
The argument n of ngx_strcasestrn must be length of the second substring - 1. But the length 4 is passed in the code.
Metadata
Metadata
Assignees
Labels
No labels