You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Yup, completely agree. I went for the naive thing just to avoid taking a dependency on some lib with header parsing. Since there’s only one header we really care about though this should still be quite simple
I did PR to allow for parsing headers in any order here #11. I added some additional unit tests to cover some new scenarios as well. If I understood correctly, the intention was that the listen method should never raise. But instead just break on error (corrupt headers/messages)? Feel free to have a look.
Hi,
Currently python-jsonrpc-server requires the Content-Length header to be sent first. I guess the following snippet is causing the issue:
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
The text was updated successfully, but these errors were encountered: