]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1874616 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 6 Mar 2020 16:14:06 +0000 (16:14 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 6 Mar 2020 16:14:06 +0000 (16:14 +0000)
PR64140: Allow %{Content-Type} in health check expressions

Submitted By: Renier Velazco <renier.velazco upr.edu>
Commited By: covener

Github: closes #97

Submitted by: covener
Reviewed by: covener, ylavic, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1874908 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/proxy/mod_proxy_hcheck.c

diff --git a/CHANGES b/CHANGES
index b5b8e35285963d55053549dfd04a103089f05d37..cb7b647ef301a71df6722fa5cc61454e73f25e49 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.42
 
+  *) mod_proxy_hcheck: Allow healthcheck expressions to use %{Content-Type}.
+     PR64140. [Renier Velazco <renier.velazco upr.edu>]
+
   *) mod_authz_groupfile: Drop AH01666 from loglevel "error" to "info".
      PR64172.
 
diff --git a/STATUS b/STATUS
index 99c4a0f2623368cac29090e400606bef56ce50df..b069466ee1cb6c229336dcad4cfc2acfe4d5d765 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -146,11 +146,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: svn merge -c 1874323 ^/httpd/httpd/trunk .
      +1: ylavic, gsmith, rpluem
 
-  *) mod_proxy_hcheck: Allow %{Content-Type} to work in expressions
-     trunk patch: http://svn.apache.org/r1874616
-     2.4.x patch:  svn merge -c 1874616 ^/httpd/httpd/trunk .
-     +1: covener, ylavic, jim
-
   *) mod_http2: Fixes issue where mod_unique_id would generate non-unique request
      identifier under load, see <https://github.com/icing/mod_h2/issues/195>.
      trunk patch: http://svn.apache.org/r1874689
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;
 }