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:
@@ -370,6 +370,7 @@ HttpUtils_ParseAnswer($$)
|
|||||||
} else {
|
} else {
|
||||||
my $ra;
|
my $ra;
|
||||||
map { $ra=$1 if($_ =~ m/Location:\s*(\S+)$/) } @header;
|
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;
|
$hash->{url} = ($ra =~ m/^http/) ? $ra: $hash->{addr}.$ra;
|
||||||
Log3 $hash, $hash->{loglevel}, "HttpUtils $hash->{displayurl}: ".
|
Log3 $hash, $hash->{loglevel}, "HttpUtils $hash->{displayurl}: ".
|
||||||
"Redirect to ".($hash->{hideurl} ? "<hidden>" : $hash->{url});
|
"Redirect to ".($hash->{hideurl} ? "<hidden>" : $hash->{url});
|
||||||
|
|||||||
Reference in New Issue
Block a user