Skip to content

Conversation

@zhongyi51
Copy link

Fixed #113 .


Description

According to #113 , the existing implementation of event_parser.rs does not support stripping the UTF-8 BOM header. I fixed this by introducing a state machine (BomHeaderState) in EventParser. It buffers the initial data from the first message, strips BOM header if it exists, and passes the following data to the downstream parser.

This may introduce an extra memory allocation at the beginning of the connection, but for the rest of the stream, the overhead is negligible (just a single if check).

@zhongyi51 zhongyi51 requested a review from a team as a code owner January 30, 2026 14:47
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.

Potential Bug for UTF-8 BOM strip

1 participant