header_ok: Fix typo(?) in HTTP response regular expression

This commit is contained in:
Richard Hansen 2024-05-14 23:51:37 -04:00
parent 211d59fccc
commit 2d4a93d5e7

View file

@ -3775,8 +3775,7 @@ sub nic_updateable {
sub header_ok { sub header_ok {
my ($host, $line) = @_; my ($host, $line) = @_;
$line =~ s/\r?\n.*//s; $line =~ s/\r?\n.*//s;
# TODO: What is this leading /s*/? Is it a typo of /\s*/? my ($code, $msg) = ($line =~ qr%^\s*HTTP/.*\s+(\d+)\s*(?:\s+([^\s].*))?$%i);
my ($code, $msg) = ($line =~ qr%^s*HTTP/.*\s+(\d+)\s*(?:\s+([^\s].*))?$%i);
if (!defined($code)) { if (!defined($code)) {
failed('updating %s: unexpected HTTP response: %s', $host, $line); failed('updating %s: unexpected HTTP response: %s', $host, $line);
return 0; return 0;