From cf4fa954a9865ba43461732c03a4ec3da1b4e487 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 26 Jun 2013 15:03:54 +0200 Subject: [PATCH] Don't bother copying X-Cake to Cookie if it's empty. --- etc/mod_perl/MyApache2/CopyCookie.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/mod_perl/MyApache2/CopyCookie.pm b/etc/mod_perl/MyApache2/CopyCookie.pm index 86e9b69..10b1b10 100644 --- a/etc/mod_perl/MyApache2/CopyCookie.pm +++ b/etc/mod_perl/MyApache2/CopyCookie.pm @@ -26,8 +26,10 @@ sub handler { $cookie = $hi->get('Cookie'); if (!defined $cookie || $cookie eq "") { $cookie = $hi->get('X-Cake'); - warn "copying X-Cake '$cookie' to Cookie"; - $hi->set('Cookie', $cookie); + if (defined $cookie && $cookie ne "") { + warn "copying X-Cake '$cookie' to Cookie"; + $hi->set('Cookie', $cookie); + } } while ($f->read(my $buffer, BUFF_LEN)) { -- 1.7.10.4