From 5b11fa3aaf8a3d8fa25fe30ea370f8a8f8dfbf3d Mon Sep 17 00:00:00 2001 From: z3bra Date: Wed, 22 Oct 2014 17:35:04 +0200 Subject: testing/thttpd: new aport --- testing/thttpd/forwarded-for.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 testing/thttpd/forwarded-for.patch (limited to 'testing/thttpd/forwarded-for.patch') 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 || -- cgit v1.2.3