From 0f496bb29f7942d8652193a91eed02076dc7cea5 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 8 Jan 2026 01:03:23 +0100 Subject: [PATCH] lib/perl/NB/CGI.pm --- lib/perl/NB/CGI.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/perl/NB/CGI.pm b/lib/perl/NB/CGI.pm index a53c9636..ae36dfa1 100644 --- a/lib/perl/NB/CGI.pm +++ b/lib/perl/NB/CGI.pm @@ -43,7 +43,7 @@ sub new { # NB 06.12.23 } # NB 06.12.23 } -sub header_status { +sub status_msg { my %status_codes = ( 100 => "Continue", 101 => "Switching Protocols", @@ -130,6 +130,13 @@ sub header_status { 530 => "Site is frozen", 599 => "Network connect timeout error", ); + # NB 08.01.26 my($self,@p) = &self_or_default(@_); + my $status = $_[0]; + #die $status; + return $status_codes{$status}; +} + +sub header_status { return "" if $NO_HEADERS; my($self,@p) = &self_or_default(@_); return "" if $self->{'.header_status_printed'}++ and $CGI::HEADERS_ONCE; @@ -138,7 +145,8 @@ sub header_status { return '' unless $status; #die $status; #die $status_codes{$status}; - $status = $status." ".$status_codes{$status} if $status_codes{$status}; + my $msg = status_msg($status); + $status = $status." ".$msg if $msg; return ($ENV{SERVER_PROTOCOL} || 'HTTP/1.1')." $status\r\n"; } -- 2.47.3