- Fix a problem with proxy where each entry of a duplicated
header such as Set-Cookie would overwrite and obliterate the
previous value of the header, resulting in multiple header
values (like cookies) going missing.
- Fix a problem with proxy where X-Cache headers were
overwriting and then obliterating upstream X-Cache headers
from other proxies.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@93364
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 1.3.24
+
+ *) Fix a problem with proxy where each entry of a duplicated
+ header such as Set-Cookie would overwrite and obliterate the
+ previous value of the header, resulting in multiple header
+ values (like cookies) going missing.
+ [Graham Leggett, Joshua Slive]
+
+ *) Fix a problem with proxy where X-Cache headers were
+ overwriting and then obliterating upstream X-Cache headers
+ from other proxies.
+ [Graham Leggett, Jacob Rief <jacob.rief@tiscover.com>]
+
*) Win32: Work around a bug in Windows XP that caused data
corruption on writes to the network. The WinXP bug
is tickled by the combined use of WSADuplicateSocket
#endif
#endif
-#ifndef ap_private_extern
-#if defined(DARWIN)
+#if defined(MAC_OS) || defined(MAC_OS_X_SERVER)
#define ap_private_extern __private_extern__
#else
#define ap_private_extern
#endif
-#endif
typedef off_t regoff_t;
typedef struct {
/* Prepare and send headers to client */
ap_overlap_tables(r->headers_out, c->hdrs, AP_OVERLAP_TABLES_SET);
- ap_table_setn(r->headers_out, "X-Cache", c->xcache);
+ /* make sure our X-Cache header does not stomp on a previous header */
+ ap_table_mergen(r->headers_out, "X-Cache", c->xcache);
r->content_type = ap_table_get(r->headers_out, "Content-Type");
ap_send_http_header(r);
if (!( (-1 < smaxage && age < smaxage) ||
(-1 < maxage && age < maxage) ||
(c->expire != BAD_DATE && (c->expire - c->date) > age) )) {
- ap_table_set(c->hdrs, "Warning", "110 Response is stale");
+ /* make sure we don't stomp on a previous warning */
+ ap_table_merge(c->hdrs, "Warning", "110 Response is stale");
}
/* check conditionals (If-Modified-Since, etc) */
* HTTP/1.1 requires us to accept 3 types of dates, but only generate
* one type
*/
+ /* we SET the dates here, obliterating possible multiple dates, as only
+ * one of each date makes sense in each response.
+ */
if ((datestr = ap_table_get(resp_hdrs, "Date")) != NULL)
ap_table_set(resp_hdrs, "Date", ap_proxy_date_canon(p, datestr));
if ((datestr = ap_table_get(resp_hdrs, "Last-Modified")) != NULL)
/* Setup the headers for our client from upstreams response-headers */
ap_overlap_tables(r->headers_out, resp_hdrs, AP_OVERLAP_TABLES_SET);
- /* Add X-Cache header */
- ap_table_setn(r->headers_out, "X-Cache",
+ /* Add X-Cache header - be careful not to obliterate any upstream headers */
+ ap_table_mergen(r->headers_out, "X-Cache",
ap_pstrcat(r->pool, "MISS from ",
ap_get_server_name(r), NULL));
/* The Content-Type of this response is the upstream one. */
for (end = &value[strlen(value)-1]; end > value && ap_isspace(*end); --end)
*end = '\0';
- ap_table_add(resp_hdrs, buffer, value);
+ /* make sure we merge so as not to destroy duplicated headers */
+ ap_table_merge(resp_hdrs, buffer, value);
/* the header was too long; at the least we should skip extra data */
if (len >= size - 1) {