mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
set a user agent when attempting to retrieve $schema JSON Schemas (#190726)
This commit is contained in:
parent
829932cb62
commit
69b2435e14
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ExtensionContext, OutputChannel, window, workspace, l10n } from 'vscode';
|
||||
import { ExtensionContext, OutputChannel, window, workspace, l10n, env } from 'vscode';
|
||||
import { startClient, LanguageClientConstructor, SchemaRequestService, languageServerDescription } from '../jsonClient';
|
||||
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient, BaseLanguageClient } from 'vscode-languageclient/node';
|
||||
|
||||
|
@ -129,7 +129,10 @@ async function getSchemaRequestService(context: ExtensionContext, log: Log): Pro
|
|||
const isXHRResponse = (error: any): error is XHRResponse => typeof error?.status === 'number';
|
||||
|
||||
const request = async (uri: string, etag?: string): Promise<string> => {
|
||||
const headers: Headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||
const headers: Headers = {
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
'User-Agent': `${env.appName} (${env.appHost})`
|
||||
};
|
||||
if (etag) {
|
||||
headers['If-None-Match'] = etag;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue