@microsoft/teamsfx 1.0.0-alpha.088c35095.0 → 1.0.0-alpha.0ef74924e.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.
@@ -1639,8 +1639,12 @@ class ApiKeyProvider {
1639
1639
  if (!config.params) {
1640
1640
  config.params = {};
1641
1641
  }
1642
- const url = new URL(config.url, config.baseURL);
1643
- if (config.params[this.keyName] || url.searchParams.has(this.keyName)) {
1642
+ let urlHasDefinedApiKey = false;
1643
+ if (config.url) {
1644
+ const url = new URL(config.url, config.baseURL);
1645
+ urlHasDefinedApiKey = url.searchParams.has(this.keyName);
1646
+ }
1647
+ if (config.params[this.keyName] || urlHasDefinedApiKey) {
1644
1648
  throw new ErrorWithCode(formatString(ErrorMessage.DuplicateApiKeyInQueryParam, this.keyName), exports.ErrorCode.AuthorizationInfoAlreadyExists);
1645
1649
  }
1646
1650
  config.params[this.keyName] = this.keyValue;