From: Yann Ylavic Date: Wed, 14 May 2014 17:34:05 +0000 (+0000) Subject: mod_cache: follow up to r1594643. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a90e8ee8df06876846a810c41a3be56f734242bc;p=thirdparty%2Fapache%2Fhttpd.git mod_cache: follow up to r1594643. Avoid table lookup if not necessary (fast path first). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594648 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index 05cd3e09c9e..bf450931927 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -1256,14 +1256,14 @@ apr_table_t *cache_merge_headers_out(request_rec *r) r->err_headers_out); apr_table_clear(r->err_headers_out); - if (!apr_table_get(headers_out, "Content-Type") - && r->content_type) { + if (r->content_type + && !apr_table_get(headers_out, "Content-Type")) { apr_table_setn(headers_out, "Content-Type", ap_make_content_type(r, r->content_type)); } - if (!apr_table_get(headers_out, "Content-Encoding") - && r->content_encoding) { + if (r->content_encoding + && !apr_table_get(headers_out, "Content-Encoding")) { apr_table_setn(headers_out, "Content-Encoding", r->content_encoding); }