From: Nicolas Boisselier Date: Tue, 5 Dec 2023 15:49:18 +0000 (+0100) Subject: fix bug expires X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=b3b224e4727180f614e42390ca07467a8ceee14a;p=nb.git fix bug expires --- diff --git a/lib/perl/NB/CGI.pm b/lib/perl/NB/CGI.pm index d332a0e2..fa92b9d4 100644 --- a/lib/perl/NB/CGI.pm +++ b/lib/perl/NB/CGI.pm @@ -254,7 +254,8 @@ sub header { my %p = &args2hash(@p); #&argsAdd(\@p,'expires',-1) unless $p{expires}; # Cache-Control: private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0 - if ($p{expires}||0 =~ /^\d+$/ and $p{expires}||0 <=0) + $p{expires} ||= 0; + if ($p{expires} =~ /^\d+$/ and $p{expires} <=0) { %p = &argsAdd(\@p,'Cache-Control','private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0'); %p = &argsAdd(\@p,'Pragma','no-cache');