Error when invoking the open external command: Error in response: Unable to parse response as JSON. Fixes microsoft/vscode-remote-release#6412

This commit is contained in:
Martin Aeschlimann
2022-03-23 17:56:19 +01:00
parent e5ff686734
commit 14d04974ae

View File

@@ -81,7 +81,7 @@ export class CLIServerBase {
private onRequest(req: http.IncomingMessage, res: http.ServerResponse): void {
const sendResponse = (statusCode: number, returnObj: any) => {
res.writeHead(statusCode, { 'content-type': 'application/json' });
res.end(JSON.stringify(returnObj), (err?: any) => err && this.logService.error(err));
res.end(JSON.stringify(returnObj || null), (err?: any) => err && this.logService.error(err));
};
const chunks: string[] = [];