projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6cddf1
)
Handle X-Forwarded-Host: properly
author
Art Cancro
<ajc@citadel.org>
Wed, 8 Sep 2010 18:53:20 +0000
(14:53 -0400)
committer
Art Cancro
<ajc@citadel.org>
Wed, 8 Sep 2010 18:53:20 +0000
(14:53 -0400)
webcit/context_loop.c
patch
|
blob
|
history
diff --git
a/webcit/context_loop.c
b/webcit/context_loop.c
index aada8bee64b2ab37662489f914d22338cf3575bc..2dd63c9a2efdb551193577e536d64489caa7b04a 100644
(file)
--- 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);
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)
{
}
}
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);
}
}
}
}