From b3b224e4727180f614e42390ca07467a8ceee14a Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 5 Dec 2023 16:49:18 +0100 Subject: [PATCH] fix bug expires --- lib/perl/NB/CGI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); -- 2.47.3