|
| 1 | +import { GlobalStateService } from './global-state.service'; |
1 | 2 | import { Host } from './../models/host';
|
2 | 3 | import { ArmSiteDescriptor } from './../resourceDescriptors';
|
3 | 4 | import { HttpMethods, HttpConstants } from './../models/constants';
|
@@ -156,6 +157,7 @@ export class FunctionAppService {
|
156 | 157 | private _userService: UserService,
|
157 | 158 | private _injector: Injector,
|
158 | 159 | private _portalService: PortalService,
|
| 160 | + private _globalStateService: GlobalStateService, |
159 | 161 | logService: LogService) {
|
160 | 162 |
|
161 | 163 | this.runtime = new ConditionalHttpClient(_cacheService, logService, context => this.getRuntimeToken(context), 'NoClientCertificate', 'NotOverQuota', 'NotStopped', 'ReachableLoadballancer');
|
@@ -301,10 +303,15 @@ export class FunctionAppService {
|
301 | 303 | return this.azure.executeWithConditions([], context, t =>
|
302 | 304 | this.getExtensionVersionFromAppSettings(context)
|
303 | 305 | .mergeMap(extensionVersion => {
|
| 306 | + const headers = this.portalHeaders(t); |
| 307 | + if (this._globalStateService.showTryView) { |
| 308 | + headers.delete('Authorization'); |
| 309 | + } |
| 310 | + |
304 | 311 | return this._cacheService.get(
|
305 | 312 | Constants.serviceHost + 'api/templates?runtime=' + (extensionVersion || 'latest'),
|
306 | 313 | true,
|
307 |
| - this.portalHeaders(t)); |
| 314 | + headers); |
308 | 315 | })
|
309 | 316 | .map(r => {
|
310 | 317 | const object = r.json();
|
@@ -567,8 +574,18 @@ export class FunctionAppService {
|
567 | 574 | }
|
568 | 575 |
|
569 | 576 | return this.azure.execute(context, t => this.getExtensionVersionFromAppSettings(context)
|
570 |
| - .concatMap(extensionVersion => |
571 |
| - this._cacheService.get(`${Constants.serviceHost}api/bindingconfig?runtime=${extensionVersion}`, false, this.portalHeaders(t))) |
| 577 | + .concatMap(extensionVersion => { |
| 578 | + if (!extensionVersion) { |
| 579 | + extensionVersion = 'latest'; |
| 580 | + } |
| 581 | + |
| 582 | + const headers = this.portalHeaders(t); |
| 583 | + if(this._globalStateService.showTryView){ |
| 584 | + headers.delete('Authorization'); |
| 585 | + } |
| 586 | + |
| 587 | + return this._cacheService.get(`${Constants.serviceHost}api/bindingconfig?runtime=${extensionVersion}`, false, headers) |
| 588 | + }) |
572 | 589 | .map(r => {
|
573 | 590 | const object = r.json();
|
574 | 591 | this.localize(object);
|
|
0 commit comments