Don't bother copying X-Cake to Cookie if it's empty.
[mkws-moved-to-github.git] / etc / mod_perl / MyApache2 / CopyCookie.pm
index 86e9b69..10b1b10 100644 (file)
@@ -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)) {