01_FHEMWEB.pm: Add redirect fix (Forum #40654)

git-svn-id: https://svn.fhem.de/fhem/trunk@9318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-09-27 08:52:45 +00:00
parent 69f8622196
commit 8891d2be4b

View File

@@ -370,6 +370,7 @@ HttpUtils_ParseAnswer($$)
} else {
my $ra;
map { $ra=$1 if($_ =~ m/Location:\s*(\S+)$/) } @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}: ".
"Redirect to ".($hash->{hideurl} ? "<hidden>" : $hash->{url});