aboutsummaryrefslogtreecommitdiffstats
path: root/testing/thttpd/forwarded-for.patch
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2014-10-22 21:05:17 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2014-10-22 21:05:17 +0200
commit0551b3bbdfb33c13cea4c24bea9c1fae8829b451 (patch)
tree44c410b0aaa64b39e4ed6ebe0aad5dfbce2307f8 /testing/thttpd/forwarded-for.patch
parentfca3cd4a182c8a9cc74da96631437269e37bb698 (diff)
parente158a0f5f67c9fb95360c79f1b6357cfa4b4ba8b (diff)
downloadaports-0551b3bbdfb33c13cea4c24bea9c1fae8829b451.tar.bz2
aports-0551b3bbdfb33c13cea4c24bea9c1fae8829b451.tar.xz
Merge branch 'dev' of https://github.com/z3bratabs/aports into z3bratabs-dev
Diffstat (limited to 'testing/thttpd/forwarded-for.patch')
-rw-r--r--testing/thttpd/forwarded-for.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/thttpd/forwarded-for.patch b/testing/thttpd/forwarded-for.patch
new file mode 100644
index 0000000000..348eb00cf2
--- /dev/null
+++ b/testing/thttpd/forwarded-for.patch
@@ -0,0 +1,16 @@
+diff -Naur old/libhttpd.c new/libhttpd.c
+--- old/libhttpd.c 2005-06-30 03:50:39.000000000 +1000
++++ new/libhttpd.c 2012-10-24 12:12:17.144560917 +1100
+@@ -2207,6 +2207,12 @@
+ if ( strcasecmp( cp, "keep-alive" ) == 0 )
+ hc->keep_alive = 1;
+ }
++ else if ( strncasecmp( buf, "X-Forwarded-For:", 16 ) == 0 )
++ {
++ cp = &buf[16];
++ cp += strspn( cp, " \t" );
++ inet_aton( cp, &(hc->client_addr.sa_in.sin_addr) );
++ }
+ #ifdef LOG_UNKNOWN_HEADERS
+ else if ( strncasecmp( buf, "Accept-Charset:", 15 ) == 0 ||
+ strncasecmp( buf, "Accept-Language:", 16 ) == 0 ||