summaryrefslogtreecommitdiff
path: root/mod_ip.c
diff options
context:
space:
mode:
authorJason Fesler <jfesler@Jasons-MacBook-Pro-2.local>2020-04-18 19:21:42 -0700
committerJason Fesler <jfesler@Jasons-MacBook-Pro-2.local>2020-04-18 19:21:42 -0700
commit3560dc3dd66191e0a79bb29ffdd9b2fdd9531ad6 (patch)
tree3c1adf1fc30036713f800acbe9cd2708a5ccf4ce /mod_ip.c
parentc89f82a737a3b2145b49e649ad77a890745c0554 (diff)
downloadmod_ip-3560dc3dd66191e0a79bb29ffdd9b2fdd9531ad6.tar.gz
mod_ip-3560dc3dd66191e0a79bb29ffdd9b2fdd9531ad6.zip
latest
Diffstat (limited to 'mod_ip.c')
-rw-r--r--mod_ip.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mod_ip.c b/mod_ip.c
index 9b5db0d..be41481 100644
--- a/mod_ip.c
+++ b/mod_ip.c
@@ -31,6 +31,9 @@
/* Changes:
*
+ * 2020-04-18 - jfesler@gigo.com
+ * Support X-Real-IP
+ *
* 2013-04-29 - jfesler@gigo.com
* Add headers to output (content type, expires, cache control)
* Stop depending on mod_headers (and user config)
@@ -356,23 +359,19 @@ gen_output (request_rec * r, struct mod_ip_request_t *formdata)
char *p = NULL;
int added = 0;
char *myip = CLIENT_IP(r);
- char *realip = escape_string (r, (char *) apr_table_get (r->headers_in, "X-Real-IP"));
char *mytype = "ipv4";
char *mysubtype = "";
char *VIA = "";
char *RIP = "";
char *asnlist = NULL;
- if realip != NULL && strlen(realip)>0 {
- myip=realip
- }
/* 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
+ myip = RIP;
if (!myip)
myip = "0.0.0.0 undefined";
if (formdata->testip)