[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [3098] Use the `Host' value used by the client for the
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [3098] Use the `Host' value used by the client for the `Via' header. |
Date: |
Sun, 24 May 2009 18:42:26 +0000 |
Revision: 3098
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3098
Author: gscrivano
Date: 2009-05-24 18:42:26 +0000 (Sun, 24 May 2009)
Log Message:
-----------
Use the `Host' value used by the client for the `Via' header. Keep old `Via'
values that may be present in the header.
Modified Paths:
--------------
trunk/myserver/src/http_handler/proxy/proxy.cpp
Modified: trunk/myserver/src/http_handler/proxy/proxy.cpp
===================================================================
--- trunk/myserver/src/http_handler/proxy/proxy.cpp 2009-05-24 11:22:44 UTC
(rev 3097)
+++ trunk/myserver/src/http_handler/proxy/proxy.cpp 2009-05-24 18:42:26 UTC
(rev 3098)
@@ -161,8 +161,19 @@
checkDataChunks (td, &keepalive, &useChunks);
- td->response.setValue ("Via", Server::getInstance()->getServerName());
+ string *tmp = td->request.getValue ("Host", NULL);
+ const char *via = tmp ? tmp->c_str () : td->connection->getLocalIpAddr ();
+ tmp = td->response.getValue ("Via", NULL);
+ if (tmp)
+ {
+ tmp->append (", ");
+ tmp->append (via);
+ td->response.setValue ("Via", tmp->c_str ());
+ }
+ else
+ td->response.setValue ("Via", via);
+
if (useChunks)
td->response.setValue ("Transfer-Encoding", "chunked");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [3098] Use the `Host' value used by the client for the `Via' header.,
Giuseppe Scrivano <=