@microsoft/teamsfx 1.0.0-alpha.088c35095.0 → 1.0.0-alpha.3511f64fb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1580,8 +1580,12 @@ class ApiKeyProvider {
1580
1580
  if (!config.params) {
1581
1581
  config.params = {};
1582
1582
  }
1583
- const url = new URL(config.url, config.baseURL);
1584
- if (config.params[this.keyName] || url.searchParams.has(this.keyName)) {
1583
+ let urlHasDefinedApiKey = false;
1584
+ if (config.url) {
1585
+ const url = new URL(config.url, config.baseURL);
1586
+ urlHasDefinedApiKey = url.searchParams.has(this.keyName);
1587
+ }
1588
+ if (config.params[this.keyName] || urlHasDefinedApiKey) {
1585
1589
  throw new ErrorWithCode(formatString(ErrorMessage.DuplicateApiKeyInQueryParam, this.keyName), ErrorCode.AuthorizationInfoAlreadyExists);
1586
1590
  }
1587
1591
  config.params[this.keyName] = this.keyValue;