patch 9.0.1487: Content-type header for LSP channel not according to spec
Problem: Content-type header for LSP channel not according to spec.
Solution: Use "vscode-jsonrpc" instead of "vim-jsonrpc". (Yegappan
Lakshmanan, closes #12295)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index a6b25c9..6be2137 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -2670,7 +2670,7 @@
" " Test for sending a raw message
" let g:lspNotif = []
" let s = "Content-Length: 62\r\n"
- " let s ..= "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ " let s ..= "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
" let s ..= "\r\n"
" let s ..= '{"method":"echo","jsonrpc":"2.0","params":{"m":"raw-message"}}'
" call ch_sendraw(ch, s)
diff --git a/src/testdir/test_channel_lsp.py b/src/testdir/test_channel_lsp.py
index 10b4fb4..dd107be 100644
--- a/src/testdir/test_channel_lsp.py
+++ b/src/testdir/test_channel_lsp.py
@@ -35,7 +35,7 @@
v['id'] = msgid
s = json.dumps(v)
resp = "Content-Length: " + str(len(s)) + "\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
if self.debug:
@@ -46,7 +46,7 @@
v = 'wrong-payload'
s = json.dumps(v)
resp = "Content-Length: " + str(len(s)) + "\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
self.request.sendall(resp.encode('utf-8'))
@@ -60,7 +60,7 @@
def send_empty_payload(self):
resp = "Content-Length: 0\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
self.request.sendall(resp.encode('utf-8'))
@@ -71,7 +71,7 @@
resp = "Host: abc.vim.org\r\n"
resp += "User-Agent: Python\r\n"
resp += "Accept-Language: en-US,en\r\n"
- resp += "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp += "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "Content-Length: " + str(len(s)) + "\r\n"
resp += "\r\n"
resp += s
@@ -93,7 +93,7 @@
# test for sending the http header without length
v = {'jsonrpc': '2.0', 'id': msgid, 'result': resp_dict}
s = json.dumps(v)
- resp = "Content-Type: application/vim-jsonrpc; charset=utf-8\r\n"
+ resp = "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\n"
resp += "\r\n"
resp += s
self.request.sendall(resp.encode('utf-8'))