From: Mike Taylor Date: Wed, 26 Jun 2013 13:03:54 +0000 (+0200) Subject: Don't bother copying X-Cake to Cookie if it's empty. X-Git-Tag: 0.9.1~482 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=cf4fa954a9865ba43461732c03a4ec3da1b4e487 Don't bother copying X-Cake to Cookie if it's empty. --- 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)) {