Skip to content

Allow any order of headers in base protocol #9

Description

@kristopher-h

Hi,

Currently python-jsonrpc-server requires the Content-Length header to be sent first. I guess the following snippet is causing the issue:

        content_length = self._content_length(line)

        # Blindly consume all header lines
        while line and line.strip():
             line = self._rfile.readline()

I think it would be good to allow reading headers in any order. The LSP specification doesn't mention anything about order, even though it is listed in one, leaving it a bit open for interpretation.

Let me know if you would like a PR with a suggestion for a fix (assuming you agree with my conclusion that is).

Regards

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions