From e0af4c7875c56881a82032b2467c6b6ac2740b15 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 8 Sep 2010 14:53:20 -0400 Subject: [PATCH] Handle X-Forwarded-Host: properly --- webcit/context_loop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webcit/context_loop.c b/webcit/context_loop.c index aada8bee6..2dd63c9a2 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -675,14 +675,15 @@ void Header_HandleHost(StrBuf *Line, ParsedHttpHdrs *hdr) site_prefix = NewStrBuf(); StrBufAppendPrintf(site_prefix, "%s://", (is_https ? "https" : "http") ); StrBufAppendBuf(site_prefix, Line, 0); - lprintf(CTDL_DEBUG, "\033[33m [%s] \033[0m\n", ChrPtr(site_prefix)); } } void Header_HandleXFFHost(StrBuf *Line, ParsedHttpHdrs *hdr) { - if (follow_xff) { - /* FIXME do something here */ + if ( (follow_xff) && (site_prefix == NULL)) { + site_prefix = NewStrBuf(); + StrBufAppendPrintf(site_prefix, "http://"); /* this is naive; do something about it */ + StrBufAppendBuf(site_prefix, Line, 0); } } -- 2.30.2