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:
parent
958a1c3231
commit
451b4b6a01
@ -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}: ".
|
||||
|
Loading…
Reference in New Issue
Block a user