}
/* Let's see what our current Content-Encoding is.
- * If gzip is present, don't gzip again. (We could, but let's not.)
+ * If it's already encoded, don't compress again.
+ * (We could, but let's not.)
*/
encoding = apr_table_get(r->headers_out, "Content-Encoding");
if (encoding) {
const char *tmp = encoding;
token = ap_get_token(r->pool, &tmp, 0);
- while (token && token[0]) {
- if (!strcasecmp(token, "gzip")) {
+ while (token && *token) {
+ /* stolen from mod_negotiation: */
+ if (strcmp(token, "identity") && strcmp(token, "7bit") &&
+ strcmp(token, "8bit") && strcmp(token, "binary")) {
+
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
+
/* Otherwise, skip token */
- tmp++;
- token = ap_get_token(r->pool, &tmp, 0);
+ if (*tmp) {
+ ++tmp;
+ }
+ token = (*tmp) ? ap_get_token(r->pool, &tmp, 0) : NULL;
}
}