From dc9c061c342cbc06e004757e72d4984153b64d14 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 24 Apr 2021 08:36:08 +0000 Subject: [PATCH] 01_Fhemweb.pm: case insensitive Sec-WebSocket header (Forum #88205) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24322 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/01_FHEMWEB.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FHEM/01_FHEMWEB.pm b/FHEM/01_FHEMWEB.pm index 21c7adf95..58e78ff64 100644 --- a/FHEM/01_FHEMWEB.pm +++ b/FHEM/01_FHEMWEB.pm @@ -457,7 +457,8 @@ FW_Read($$) @FW_httpheader = split(/[\r\n]+/, $hash->{HDR}); %FW_httpheader = map { my ($k,$v) = split(/: */, $_, 2); - $k =~ s/(\w+)/\u$1/g; # Forum #39203 + $k = lc($k); #88205 + $k =~ s/(\w+)/\u$1/g; #39203 $k=>(defined($v) ? $v : 1); } @FW_httpheader; delete($hash->{HDR}); @@ -542,9 +543,9 @@ FW_Read($$) if($FW_use{sha} && $method eq 'GET' && $FW_httpheader{Connection} && $FW_httpheader{Connection} =~ /Upgrade/i && $FW_httpheader{Upgrade} && $FW_httpheader{Upgrade} =~ /websocket/i && - $FW_httpheader{'Sec-WebSocket-Key'}) { + $FW_httpheader{'Sec-Websocket-Key'}) { - my $shastr = Digest::SHA::sha1_base64($FW_httpheader{'Sec-WebSocket-Key'}. + my $shastr = Digest::SHA::sha1_base64($FW_httpheader{'Sec-Websocket-Key'}. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); TcpServer_WriteBlocking($FW_chash,