From: Jim Jagielski Date: Fri, 6 Mar 2020 16:14:06 +0000 (+0000) Subject: Merge r1874616 from trunk: X-Git-Tag: 2.4.42~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4127d496be3634999fef005048e8ee13040c338;p=thirdparty%2Fapache%2Fhttpd.git Merge r1874616 from trunk: PR64140: Allow %{Content-Type} in health check expressions Submitted By: Renier Velazco 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 --- diff --git a/CHANGES b/CHANGES index b5b8e352859..cb7b647ef30 100644 --- 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 ] + *) mod_authz_groupfile: Drop AH01666 from loglevel "error" to "info". PR64172. diff --git a/STATUS b/STATUS index 99c4a0f2623..b069466ee1c 100644 --- 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 . trunk patch: http://svn.apache.org/r1874689 diff --git a/modules/proxy/mod_proxy_hcheck.c b/modules/proxy/mod_proxy_hcheck.c index 1307d5ae2b5..9854e348a53 100644 --- a/modules/proxy/mod_proxy_hcheck.c +++ b/modules/proxy/mod_proxy_hcheck.c @@ -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; }