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

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9318 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-09-27 08:52:45 +00:00
parent a2b3387752
commit fa8da06957

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});