Repository navigation
Handle LSP header order and case when reading messages - #33
Open
blouirts123 wants to merge 1 commit into
Open
blouirts123 wants to merge 1 commit into
blouirts123 wants to merge 1 commit into
Conversation
blouirts123
marked this pull request as draft
October 16, 2026 04:52
blouirts123
marked this pull request as ready for review
October 16, 2026 05:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Valid LSP messages are lost when
Content-TypeprecedesContent-Length, or the length field uses mixed case: the reader examines only the first header line, fails to obtain a length, and reads subsequent frames into the same body.Find the length throughout the header block and compare the field name case-insensitively, following the LSP base protocol and HTTP field semantics. A three-frame regression checks both header ordering and mixed case before a trailing frame, so reading to EOF cannot accidentally pass.
Validation on Windows: reader tests pass on Python 3.8.20 and 3.11.15; pycodestyle, pyflakes, and pylint pass. Full suites have 27 passes and one timezone-sensitive
test_writer_bad_messagefailure on each version. A clean-base run in the same Python 3.11 environment has 26 passes and the identical failure (existing issue #6 / PR #32). Invalid framing and the existing reader error-handler limitation remain separate concerns.