Skip to content

Commit

Permalink
fixed a bug handling empty fragment incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Aug 30, 2024
1 parent b70886d commit 0091922
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ protected bool TryInitIfEmptyMessage(WebSocketPackage package)
if (package.PayloadLength != 0)
return false;

// This fragment is empty doesn't mean the whole message is empty
if (package.Head != null)
return false;

if (package.OpCode == OpCode.Text)
package.Message = string.Empty;

Expand Down

0 comments on commit 0091922

Please sign in to comment.