Patch proposal: handling multiple Set-Cookie headers from backend
MAGNIEN, Thierry
thierry.magnien at sfr.com
Tue Mar 22 14:14:55 CET 2011
Hi,
I've read the discussion on IRC channel about this: http://varnish-cache.org/trac/ticket/432
I had a look into the source code and it seemed to me that the following patch would be enough to get it working. However, I find it so simple that I'm afraid I missed something ;-)
Regards,
Thierry MAGNIEN
DGRE/DT/TPS/PFD
SFR
thierry.magnien at sfr.com
diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index e3cc4e2..a7a4e50 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -506,6 +506,7 @@ cnt_fetch(struct sess *sp)
*/
http_CollectHdr(sp->wrk->beresp, H_Cache_Control);
http_CollectHdr(sp->wrk->beresp, H_Vary);
+ http_CollectHdr(sp->wrk->beresp, H_Set_Cookie);
/*
* Figure out how the fetch is supposed to happen, before the
diff --git a/include/http_headers.h b/include/http_headers.h
index b27966d..664641f 100644
--- a/include/http_headers.h
+++ b/include/http_headers.h
@@ -92,6 +92,7 @@ HTTPH("Range", H_Range, 1, 0, HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /*
HTTPH("Referer", H_Referer, 1, 0, 0, 0, 0) /* RFC2616 14.36 */
HTTPH("Retry-After", H_Retry_After, 2, 0, 0, 0, 0) /* RFC2616 14.37 */
HTTPH("Server", H_Server, 2, 0, 0, 0, 0) /* RFC2616 14.38 */
+HTTPH("Set-Cookie", H_Set_Cookie, 2, 0, 0, 0, 0) /* RFC2109 */
HTTPH("TE", H_TE, 1, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.39 */
HTTPH("Trailer", H_Trailer, 1, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.40 */
HTTPH("Transfer-Encoding", H_Transfer_Encoding, 2, 3, HTTPH_R_PASS | HTTPH_A_PASS | HTTPH_R_FETCH | HTTPH_A_INS, 0, 0) /* RFC2616 14.41 */
More information about the varnish-dev
mailing list