From 49879a95d587c74a1675cee4a3d00fba3fbc351e Mon Sep 17 00:00:00 2001 From: Jason Fesler Date: Sat, 18 Apr 2020 18:25:42 -0700 Subject: X-Real-IP --- mod_ip.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mod_ip.c') diff --git a/mod_ip.c b/mod_ip.c index 93a96a7..9b5db0d 100644 --- a/mod_ip.c +++ b/mod_ip.c @@ -360,6 +360,7 @@ gen_output (request_rec * r, struct mod_ip_request_t *formdata) char *mytype = "ipv4"; char *mysubtype = ""; char *VIA = ""; + char *RIP = ""; char *asnlist = NULL; if realip != NULL && strlen(realip)>0 { @@ -367,8 +368,11 @@ gen_output (request_rec * r, struct mod_ip_request_t *formdata) } /* Identify X-Forwarded-For; include in results after stripping characters. */ + RIP = escape_string (r, (char *) apr_table_get (r->headers_in, "X-Real-IP")); VIA = escape_string (r, (char *) apr_table_get (r->headers_in, "Via")); + if (strlen(VIA)>0) + myip = RIP if (!myip) myip = "0.0.0.0 undefined"; if (formdata->testip) -- cgit v1.2.3