HttpUtils.pm: evaluate http header values if enclosed in {} (Forum 111959)
git-svn-id: https://svn.fhem.de/fhem/trunk@27255 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -659,7 +659,12 @@ HttpUtils_Connect2($)
|
|||||||
if(defined($hash->{header})) {
|
if(defined($hash->{header})) {
|
||||||
if( ref($hash->{header}) eq 'HASH' ) {
|
if( ref($hash->{header}) eq 'HASH' ) {
|
||||||
$hash->{header} = join("\r\n",
|
$hash->{header} = join("\r\n",
|
||||||
map(($_.': '.$hash->{header}{$_}), keys %{$hash->{header}}));
|
map { my $v = $hash->{header}{$_};
|
||||||
|
if($v =~ m/^{.+}$/){ #111959
|
||||||
|
$v = eval $v;
|
||||||
|
Log3 $hash, 1, "$hash->{NAME} httpHeader $v: $@" if($@);
|
||||||
|
}
|
||||||
|
"$_: $v" } keys %{$hash->{header}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1052,7 +1057,7 @@ HttpUtils_ParseAnswer($)
|
|||||||
# compress(1)
|
# compress(1)
|
||||||
# data("") # sending data via POST
|
# data("") # sending data via POST
|
||||||
# forceEncoding(undef) # Encode received data with this charset
|
# forceEncoding(undef) # Encode received data with this charset
|
||||||
# header("" or {})
|
# header("" or {}) # in the {} form value is evaluated if enclosed in {}
|
||||||
# hideurl(0) # hide the url in the logs
|
# hideurl(0) # hide the url in the logs
|
||||||
# httpversion("1.0")
|
# httpversion("1.0")
|
||||||
# ignoreredirects(0)
|
# ignoreredirects(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user