Skip to content

Commit

Permalink
web: WebSocket check for fin flag
Browse files Browse the repository at this point in the history
I don't have a good test case for fragmentation yet, but for now add sanity check to raise exception
  • Loading branch information
briansfrank committed Aug 3, 2023
1 parent 44b825a commit d9993c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/web/fan/WebSocket.fan
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class WebSocket
// read payload data
payload = in.readBufFully(payload, len)

// read fragmented message (not done yet!)
if (!fin) throw Err("Fragmentation not supported yet!")

// if masked, then unmask it
if (masked)
for (i := 0; i<len; ++i)
Expand Down

0 comments on commit d9993c6

Please sign in to comment.