From a91fdc229a8a2cb940ae95e0044065a5e5ebb636 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 26 Jun 2013 14:55:17 +0200 Subject: [PATCH] Set X-Set-Cookie only when there is a cookie. --- etc/mod_perl/MyApache2/CopyCookie.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/mod_perl/MyApache2/CopyCookie.pm b/etc/mod_perl/MyApache2/CopyCookie.pm index 3dbade1..64089a2 100644 --- a/etc/mod_perl/MyApache2/CopyCookie.pm +++ b/etc/mod_perl/MyApache2/CopyCookie.pm @@ -16,7 +16,9 @@ sub handler { # header other than the magic "Cookie" that clients can't read. my $ho = $f->r->headers_out; my $cookie = $ho->get('Set-Cookie'); - $ho->set('X-Set-Cookie', $cookie); + if (defined $cookie && $cookie ne "") { + $ho->set('X-Set-Cookie', $cookie); + } # If the client sent an existing cookie as X-Cookie, but didn't # set Cookie, copy the former to the latter. -- 1.7.10.4