mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 708b019bb4e20f07cf89df9f1d943af3d38d7a70 (#9657)
This commit is contained in:
@@ -26,6 +26,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { getServiceMachineId } from 'vs/platform/serviceMachineId/common/serviceMachineId';
|
||||
import { optional } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
interface IRawGalleryExtensionFile {
|
||||
assetType: string;
|
||||
@@ -387,12 +388,12 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
|
||||
@IConfigurationService private configurationService: IConfigurationService, // {{SQL CARBON EDIT}}
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@optional(IStorageService) storageService: IStorageService,
|
||||
) {
|
||||
const config = productService.extensionsGallery;
|
||||
this.extensionsGalleryUrl = config && config.serviceUrl;
|
||||
this.extensionsControlUrl = config && config.controlUrl;
|
||||
this.commonHeadersPromise = resolveMarketplaceHeaders(productService.version, this.environmentService, this.fileService, this.storageService);
|
||||
this.commonHeadersPromise = resolveMarketplaceHeaders(productService.version, this.environmentService, this.fileService, storageService);
|
||||
}
|
||||
|
||||
private api(path = ''): string {
|
||||
@@ -928,12 +929,14 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
|
||||
export async function resolveMarketplaceHeaders(version: string, environmentService: IEnvironmentService, fileService: IFileService, storageService: {
|
||||
get: (key: string, scope: StorageScope) => string | undefined,
|
||||
store: (key: string, value: string, scope: StorageScope) => void
|
||||
}): Promise<{ [key: string]: string; }> {
|
||||
} | undefined): Promise<{ [key: string]: string; }> {
|
||||
const headers: IHeaders = {
|
||||
'X-Market-Client-Id': `VSCode ${version}`,
|
||||
'User-Agent': `VSCode ${version}`
|
||||
};
|
||||
const uuid: string = await getServiceMachineId(environmentService, fileService, storageService);
|
||||
headers['X-Market-User-Id'] = uuid;
|
||||
const uuid = await getServiceMachineId(environmentService, fileService, storageService);
|
||||
if (uuid) {
|
||||
headers['X-Market-User-Id'] = uuid;
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user