mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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
This commit is contained in:
parent
4994b98d6c
commit
dc9c061c34
@ -457,7 +457,8 @@ FW_Read($$)
|
|||||||
@FW_httpheader = split(/[\r\n]+/, $hash->{HDR});
|
@FW_httpheader = split(/[\r\n]+/, $hash->{HDR});
|
||||||
%FW_httpheader = map {
|
%FW_httpheader = map {
|
||||||
my ($k,$v) = split(/: */, $_, 2);
|
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);
|
$k=>(defined($v) ? $v : 1);
|
||||||
} @FW_httpheader;
|
} @FW_httpheader;
|
||||||
delete($hash->{HDR});
|
delete($hash->{HDR});
|
||||||
@ -542,9 +543,9 @@ FW_Read($$)
|
|||||||
if($FW_use{sha} && $method eq 'GET' &&
|
if($FW_use{sha} && $method eq 'GET' &&
|
||||||
$FW_httpheader{Connection} && $FW_httpheader{Connection} =~ /Upgrade/i &&
|
$FW_httpheader{Connection} && $FW_httpheader{Connection} =~ /Upgrade/i &&
|
||||||
$FW_httpheader{Upgrade} && $FW_httpheader{Upgrade} =~ /websocket/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");
|
"258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
|
||||||
|
|
||||||
TcpServer_WriteBlocking($FW_chash,
|
TcpServer_WriteBlocking($FW_chash,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user