2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

HttpUtils.pm: websocket criteria changed (Forum #109910)

git-svn-id: https://svn.fhem.de/fhem/trunk@22119 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-06-05 08:38:10 +00:00
parent 4828c0ade0
commit 244e339831

View File

@ -683,19 +683,19 @@ HttpUtils_DataComplete($)
if(!defined($hl)) {
return 0 if($hash->{buf} !~ m/^(.*?)\r?\n\r?\n(.*)$/s);
my ($hdr, $data) = ($1, $2);
if($hdr =~ m/Transfer-Encoding:\s*chunked/si) {
if($hdr =~ m/Transfer-Encoding:\s*chunked/i) {
$hash->{httpheader} = $hdr;
$hash->{httpdata} = "";
$hash->{buf} = $data;
$hash->{httpdatalen} = -1;
} elsif($hdr =~ m/Content-Length:\s*(\d+)/si) {
} elsif($hdr =~ m/Content-Length:\s*(\d+)/i) {
$hash->{httpdatalen} = $1;
$hash->{httpheader} = $hdr;
$hash->{httpdata} = $data;
$hash->{buf} = "";
} elsif($hdr =~ m/Connection:\s*Upgrade/i) {
} elsif($hdr =~ m/Upgrade:\s*websocket/i) {
$hash->{httpdatalen} = 0;
$hash->{httpheader} = $hdr;
$hash->{httpdata} = $hash->{buf} = "";