summaryrefslogtreecommitdiffstats
path: root/modules/proxy/mod_proxy_hcheck.c
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2020-02-28 14:02:05 +0100
committerEric Covener <covener@apache.org>2020-02-28 14:02:05 +0100
commit6d43562a4a2d6f95f1a1e11b0c550624946be762 (patch)
tree0fd8b0755abcc338a4823deaf2a9ad58364e0687 /modules/proxy/mod_proxy_hcheck.c
parentSlighly simplify code. (diff)
downloadapache2-6d43562a4a2d6f95f1a1e11b0c550624946be762.tar.xz
apache2-6d43562a4a2d6f95f1a1e11b0c550624946be762.zip
PR64140: Allow %{Content-Type} in health check expressions
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
Diffstat (limited to '')
-rw-r--r--modules/proxy/mod_proxy_hcheck.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/proxy/mod_proxy_hcheck.c b/modules/proxy/mod_proxy_hcheck.c
index 1307d5ae2b..9854e348a5 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;
}