@@ -11,8 +11,6 @@ import { assign, getOrDefault } from 'vs/base/common/objects';
1111import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
1212import { IPager } from 'vs/base/common/paging' ;
1313import { IRequestService , IRequestOptions , IRequestContext , asJson , asText } from 'vs/platform/request/common/request' ;
14- import pkg from 'vs/platform/product/node/package' ;
15- import product from 'vs/platform/product/node/product' ;
1614import { isEngineValid } from 'vs/platform/extensions/node/extensionValidator' ;
1715import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
1816import { generateUuid , isUUID } from 'vs/base/common/uuid' ;
@@ -24,6 +22,7 @@ import { IFileService } from 'vs/platform/files/common/files';
2422import { URI } from 'vs/base/common/uri' ;
2523import { joinPath } from 'vs/base/common/resources' ;
2624import { VSBuffer } from 'vs/base/common/buffer' ;
25+ import { IProductService } from 'vs/platform/product/common/product' ;
2726
2827interface IRawGalleryExtensionFile {
2928 assetType : string ;
@@ -339,11 +338,12 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
339338 @IEnvironmentService private readonly environmentService : IEnvironmentService ,
340339 @ITelemetryService private readonly telemetryService : ITelemetryService ,
341340 @IFileService private readonly fileService : IFileService ,
341+ @IProductService productService : IProductService ,
342342 ) {
343- const config = product . extensionsGallery ;
343+ const config = productService . extensionsGallery ;
344344 this . extensionsGalleryUrl = config && config . serviceUrl ;
345345 this . extensionsControlUrl = config && config . controlUrl ;
346- this . commonHeadersPromise = resolveMarketplaceHeaders ( this . environmentService , this . fileService ) ;
346+ this . commonHeadersPromise = resolveMarketplaceHeaders ( productService . version , this . environmentService , this . fileService ) ;
347347 }
348348
349349 private api ( path = '' ) : string {
@@ -774,7 +774,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
774774 }
775775}
776776
777- export async function resolveMarketplaceHeaders ( environmentService : IEnvironmentService , fileService : IFileService ) : Promise < { [ key : string ] : string ; } > {
777+ export async function resolveMarketplaceHeaders ( version : string , environmentService : IEnvironmentService , fileService : IFileService ) : Promise < { [ key : string ] : string ; } > {
778778 const marketplaceMachineIdFile = URI . file ( path . join ( environmentService . userDataPath , 'machineid' ) ) ;
779779
780780 let uuid : string | null = null ;
@@ -796,8 +796,8 @@ export async function resolveMarketplaceHeaders(environmentService: IEnvironment
796796 }
797797 }
798798 return {
799- 'X-Market-Client-Id' : `VSCode ${ pkg . version } ` ,
800- 'User-Agent' : `VSCode ${ pkg . version } ` ,
799+ 'X-Market-Client-Id' : `VSCode ${ version } ` ,
800+ 'User-Agent' : `VSCode ${ version } ` ,
801801 'X-Market-User-Id' : uuid
802802 } ;
803803}
0 commit comments