projects
/
metaproxy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ebda9f
)
frontend_net: handle X-Forwarded-For
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 15 Aug 2012 14:15:00 +0000
(16:15 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 15 Aug 2012 14:15:00 +0000
(16:15 +0200)
This is stored in package.origin() and may be used in filters
as usual.
src/filter_frontend_net.cpp
patch
|
blob
|
history
diff --git
a/src/filter_frontend_net.cpp
b/src/filter_frontend_net.cpp
index
3246eec
..
7f448a2
100644
(file)
--- a/
src/filter_frontend_net.cpp
+++ b/
src/filter_frontend_net.cpp
@@
-362,6
+362,10
@@
void yf::FrontendNet::ZAssocChild::recv_GDU(Z_GDU *z_pdu, int len)
{
Z_HTTP_Request *hreq = z_pdu->u.HTTP_Request;
+ const char *f = z_HTTP_header_lookup(hreq->headers, "X-Forwarded-For");
+ if (f)
+ p->origin().set_tcpip_address(std::string(f), m_session.id());
+
if (m_p->m_stat_req.length()
&& !strcmp(hreq->path, m_p->m_stat_req.c_str()))
{