From: Art Cancro Date: Wed, 8 Sep 2010 18:53:20 +0000 (-0400) Subject: Handle X-Forwarded-Host: properly X-Git-Tag: v8.01~733 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=e0af4c7875c56881a82032b2467c6b6ac2740b15 Handle X-Forwarded-Host: properly --- 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); } }