summaryrefslogtreecommitdiff
path: root/network/thttpd/patches/forwarded-for.patch
diff options
context:
space:
mode:
authorAntonio Hernández Blas <hba.nihilismus@gmail.com>2014-11-05 18:22:25 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-11-08 06:30:11 +0700
commit60c75ff791ce88fe9bddede4997aa2c6dfea5e64 (patch)
tree2751074694fa5987c3e7fe304c9205a7aae73e5d /network/thttpd/patches/forwarded-for.patch
parent2e8081a46c101e236b26256a8440f5d6d0ab168c (diff)
downloadslackbuilds-60c75ff791ce88fe9bddede4997aa2c6dfea5e64.tar.gz
network/thttpd: Updated for version 2.26.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/thttpd/patches/forwarded-for.patch')
-rw-r--r--network/thttpd/patches/forwarded-for.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/network/thttpd/patches/forwarded-for.patch b/network/thttpd/patches/forwarded-for.patch
new file mode 100644
index 0000000000..348eb00cf2
--- /dev/null
+++ b/network/thttpd/patches/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 ||