diff options
Diffstat (limited to 'network/thttpd/patches/thttpd-2.25b-use-X-Forwarded-For-header.patch')
-rw-r--r-- | network/thttpd/patches/thttpd-2.25b-use-X-Forwarded-For-header.patch | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/network/thttpd/patches/thttpd-2.25b-use-X-Forwarded-For-header.patch b/network/thttpd/patches/thttpd-2.25b-use-X-Forwarded-For-header.patch new file mode 100644 index 0000000000..0fec25ef7c --- /dev/null +++ b/network/thttpd/patches/thttpd-2.25b-use-X-Forwarded-For-header.patch @@ -0,0 +1,15 @@ +--- thttpd-2.25b/libhttpd.c 2003-12-25 20:06:05.000000000 +0100 ++++ thttpd-2.25b-patched/libhttpd.c 2005-01-09 00:26:04.867255248 +0100 +@@ -2207,6 +2207,12 @@ + if ( strcasecmp( cp, "keep-alive" ) == 0 ) + hc->keep_alive = 1; + } ++ else if ( strncasecmp( buf, "X-Forwarded-For:", 16 ) == 0 ) ++ { // Use real IP if available ++ 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 || |