[Remove entries to the current 2.0 section below, when backported]
+ *) Fix a bug, where mod_deflate sometimes unconditionally compressed the
+ content if the Accept-Encoding header contained only other tokens than
+ "gzip" (such as "deflate"). PR 21523. [Joe Orton, André Malo]
+
*) mod_rewrite: Catch an edge case, where strange subsequent RewriteRules
could lead to a 400 (Bad Request) response. [André Malo]
token = ap_get_token(r->pool, &accepts, 0);
while (token && token[0] && strcasecmp(token, "gzip")) {
- /* skip token */
- accepts++;
- token = ap_get_token(r->pool, &accepts, 0);
+ /* skip parameters, XXX: ;q=foo evaluation? */
+ while (*accepts == ';') {
+ ++accepts;
+ token = ap_get_token(r->pool, &accepts, 1);
+ }
+
+ /* retrieve next token */
+ if (*accepts == ',') {
+ ++accepts;
+ }
+ token = (*accepts) ? ap_get_token(r->pool, &accepts, 0) : NULL;
}
/* No acceptable token found. */