mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-08 05:15:10 +00:00
01_Fhemweb.pm: case insensitive Sec-WebSocket header (Forum #88205)
git-svn-id: https://svn.fhem.de/fhem/trunk@24322 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c0c0f23310
commit
10ea719c3d
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user