Skip to content

Fix: Server Send Always Uses Binary Frame Type for Text Messages#102

Open
prjanitor wants to merge 1 commit intoPowerShellWeb:mainfrom
prjanitor:prjanitor/bfa86b917d59cbfb499b498d28166524e4d0eef3
Open

Fix: Server Send Always Uses Binary Frame Type for Text Messages#102
prjanitor wants to merge 1 commit intoPowerShellWeb:mainfrom
prjanitor:prjanitor/bfa86b917d59cbfb499b498d28166524e4d0eef3

Conversation

@prjanitor
Copy link
Copy Markdown

Bug Description

In the server-side Send.ps1, text messages were incorrectly sent with 'Binary' frame type instead of 'Text', which violates the WebSocket protocol and causes clients to misinterpret text data as binary.

Fix

Changed the frame type parameter in socket.SendAsync() from 'Binary' to 'Text' for the text message branch (the else branch that handles non-binary data).

Before

$null = $socket.SendAsync($messageSegment, 'Binary', 'EndOfMessage',[Threading.Cancellationtoken]::None)

After

$null = $socket.SendAsync($messageSegment, 'Text', 'EndOfMessage',[Threading.Cancellationtoken]::None)

Impact

  • Text messages are now correctly framed according to WebSocket protocol
  • Clients will properly interpret text data as text rather than binary
  • No breaking changes to API or functionality

This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

Changed the frame type from 'Binary' to 'Text' when sending text/JSON messages from the server. This ensures compliance with the WebSocket protocol specification and prevents clients from misinterpreting text data as binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant