2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

HttpUtils.pm: fix strange redirection (Forum #109595)

git-svn-id: https://svn.fhem.de/fhem/trunk@21529 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-03-28 07:15:44 +00:00
parent 958a1c3231
commit 451b4b6a01

View File

@ -862,8 +862,8 @@ HttpUtils_ParseAnswer($)
return ("$hash->{displayurl}: Too many redirects", "");
} else {
my $ra;
map { $ra=$1 if($_ =~ m/Location:\s*(\S+)$/) } @header;
my $ra="";
map { $ra=$1 if($_ =~ m/^Location:\s*(\S+)\s*$/i) } @header;
$ra = "/$ra" if($ra !~ m/^http/ && $ra !~ m/^\//);
$hash->{url} = ($ra =~ m/^http/) ? $ra: $hash->{addr}.$ra;
Log3 $hash, $hash->{loglevel}, "HttpUtils $hash->{displayurl}: ".