]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR64140: Allow %{Content-Type} in health check expressions
authorEric Covener <covener@apache.org>
Fri, 28 Feb 2020 13:02:05 +0000 (13:02 +0000)
committerEric Covener <covener@apache.org>
Fri, 28 Feb 2020 13:02:05 +0000 (13:02 +0000)
Submitted By: Renier Velazco <renier.velazco upr.edu>
Commited By: covener

Github: closes #97

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874616 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_hcheck.c

diff --git a/CHANGES b/CHANGES
index ee8150654e390a82b1869fb6c0e242920fcc1b8d..ca9e13066da2edc7847fed1a5f13f3bc9ec040d3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+ *) mod_proxy_hcheck: Allow healthcheck expressions to use %{Content-Type}.
+    PR64140. [Renier Velazco <renier.velazco upr.edu>]
+
   *) mod_ssl: Fix memory leak of OCSP stapling response. [Yann Ylavic]
 
   *) mod_authz_groupfile: Drop AH01666 from loglevel "error" to "info".
index 1307d5ae2b5a37286ba64ddb90328996592450f0..9854e348a53a38113713748c8952fdbf5f2ef8fb 100644 (file)
@@ -644,6 +644,7 @@ static int hc_read_headers(request_rec *r)
 {
     char buffer[HUGE_STRING_LEN];
     int len;
+    const char *ct;
 
     len = ap_getline(buffer, sizeof(buffer), r, 1);
     if (len <= 0) {
@@ -678,6 +679,7 @@ static int hc_read_headers(request_rec *r)
     } else {
         return !OK;
     }
+
     /* OK, 1st line is OK... scarf in the headers */
     while ((len = ap_getline(buffer, sizeof(buffer), r, 1)) > 0) {
         char *value, *end;
@@ -694,6 +696,11 @@ static int hc_read_headers(request_rec *r)
             *end = '\0';
         apr_table_add(r->headers_out, buffer, value);
     }
+
+    /* Set the Content-Type for the request if set */
+    if ((ct = apr_table_get(r->headers_out, "Content-Type")) != NULL)
+        ap_set_content_type(r, ct);
+
     return OK;
 }