From c62c02f24d1a86d22ad71e2861050ac3998a119c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 15 Jul 2026 10:36:29 -0400 Subject: [PATCH 1/2] Route remote schema refs through client trust checks --- extensions/json-language-features/server/README.md | 3 +-- extensions/json-language-features/server/src/jsonServer.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/json-language-features/server/README.md b/extensions/json-language-features/server/README.md index 8047006f4e3c19..68f33c0dc34748 100644 --- a/extensions/json-language-features/server/README.md +++ b/extensions/json-language-features/server/README.md @@ -29,7 +29,7 @@ The server implements the following capabilities of the language server protocol - syntax errors - structural validation based on the document's [JSON schema](http://json-schema.org/). -In order to load JSON schemas, the JSON server uses NodeJS `http` and `fs` modules. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP. +In order to load JSON schemas, the JSON server uses NodeJS `fs` modules by default and delegates all other schema requests to the client. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP. ### Client requirements @@ -127,7 +127,6 @@ let clientOptions: LanguageClientOptions = { If `handledSchemaProtocols` is not set, the JSON language server will load the following URLs itself: -- `http`, `https`: Loaded using NodeJS's HTTP support. Proxies can be configured through the settings. - `file`: Loaded using NodeJS's `fs` support. #### Schema content request diff --git a/extensions/json-language-features/server/src/jsonServer.ts b/extensions/json-language-features/server/src/jsonServer.ts index 1e109fac5a3ef4..1344943d37b8dc 100644 --- a/extensions/json-language-features/server/src/jsonServer.ts +++ b/extensions/json-language-features/server/src/jsonServer.ts @@ -88,7 +88,7 @@ const sortCodeActionKind = CodeActionKind.Source.concat('.sort', '.json'); export function startServer(connection: Connection, runtime: RuntimeEnvironment) { - function getSchemaRequestService(handledSchemas: string[] = ['https', 'http', 'file']) { + function getSchemaRequestService(handledSchemas: string[] = ['file']) { const builtInHandlers: { [protocol: string]: RequestService | undefined } = {}; for (const protocol of handledSchemas) { if (protocol === 'file') { @@ -579,4 +579,3 @@ function getFullRange(document: TextDocument): Range { - From 046741d54c1473a8d2295697b4fea0cf3db20089 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 15 Jul 2026 10:50:43 -0400 Subject: [PATCH 2/2] docs: better documentation for browser scenario Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- extensions/json-language-features/server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/json-language-features/server/README.md b/extensions/json-language-features/server/README.md index 68f33c0dc34748..7c088fe0cd7dea 100644 --- a/extensions/json-language-features/server/README.md +++ b/extensions/json-language-features/server/README.md @@ -29,7 +29,7 @@ The server implements the following capabilities of the language server protocol - syntax errors - structural validation based on the document's [JSON schema](http://json-schema.org/). -In order to load JSON schemas, the JSON server uses NodeJS `fs` modules by default and delegates all other schema requests to the client. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP. +In the Node.js build, the JSON server uses the `fs` module to load `file` schemas by default and delegates all other schema requests to the client. The browser build delegates all schema requests to the client. For all other features, the JSON server only relies on the documents and settings provided by the client through the LSP. ### Client requirements