FU: Fix warning when calling fu->set_header() with undef value

This commit is contained in:
Yorhel 2025-04-20 11:31:15 +02:00
parent 8b807e6dcf
commit f2294a709a

2
FU.pm
View file

@ -728,7 +728,7 @@ sub reset {
sub _validate_header($hdr, $val) {
confess "Invalid response header '$hdr'" if $hdr !~ /^$FU::hdrname_re$/;
confess "Invalid attempt to set response header containing a newline" if $val =~ /[\r\n]/;
confess "Invalid attempt to set response header containing a newline" if defined $val && $val =~ /[\r\n]/;
}
sub add_header($, $hdr, $val) {