Patch proposal: handling multiple Set-Cookie headers from backend

MAGNIEN, Thierry thierry.magnien at sfr.com
Tue Mar 22 17:25:45 CET 2011


OK, thanks for your response. However, does this mean my patch would be OK for a version 2.1.5 if trunk is not "production-stable" enough ?

Thierry

-----Message d'origine-----
De : phk at critter.freebsd.dk [mailto:phk at critter.freebsd.dk] De la part de Poul-Henning Kamp
Envoyé : mardi 22 mars 2011 17:17
À : MAGNIEN, Thierry
Cc : varnish-dev at varnish-cache.org
Objet : Re: Patch proposal: handling multiple Set-Cookie headers from backend 

In message <4A029B1A60B8E340A50D654D2F130DAA2FCEA3AA18 at EXCV001.encara.local.ads
>, "MAGNIEN, Thierry" writes:

>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 ;-)

You did :-)

There is a vmod_std function for doing this in -trunk now.

	import std from ...

	sub vcl_fetch {
		std.collect(resp.http.set-cookie);
	}

I'm still hoping that we'll find time/hands to produce a vmod_cookie
which would give a sensible API, so people can clearly express
what they want:

	import cookie from ...

	sub vcl_recv {
		cookie.keep_only("This_cookie", "That_cookie");
		if (cookie.get("This_cookie") == "mumblemumble") {
			...
		}
	}

	sub vcl_fetch {
		cookie.keep_only("This_cookie", "That_cookie");
	}



-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.




More information about the varnish-dev mailing list