swagger-client 3.19.3 → 3.19.5

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.
@@ -3796,8 +3796,17 @@ const HttpResolverSwaggerClient = _swagger_api_apidom_reference_configuration_em
3796
3796
  url: file.uri,
3797
3797
  signal,
3798
3798
  userFetch: async (resource, options) => {
3799
- const res = await fetch(resource, options);
3800
- res.headers.delete('Content-Type');
3799
+ let res = await fetch(resource, options);
3800
+ try {
3801
+ // node-fetch supports mutations
3802
+ res.headers.delete('Content-Type');
3803
+ } catch {
3804
+ // Fetch API has guards which prevent mutations
3805
+ res = new Response(res.body, (0,_babel_runtime_corejs3_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_corejs3_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, res), {}, {
3806
+ headers: new Headers(res.headers)
3807
+ }));
3808
+ res.headers.delete('Content-Type');
3809
+ }
3801
3810
  return res;
3802
3811
  },
3803
3812
  credentials,
@@ -4374,9 +4383,9 @@ const resolveOpenAPI31Strategy = async options => {
4374
4383
  } = options;
4375
4384
  try {
4376
4385
  // determining BaseURI
4377
- const defaultBaseURI = 'https://smartbear.com/';
4378
- const retrievalURI = _utils_options_js__WEBPACK_IMPORTED_MODULE_0__.retrievalURI(options) ?? _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.cwd();
4379
- const baseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.isHttpUrl(retrievalURI) ? retrievalURI : defaultBaseURI;
4386
+ const cwd = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.isHttpUrl(_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.cwd()) ? _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.cwd() : 'https://smartbear.com/';
4387
+ const retrievalURI = _utils_options_js__WEBPACK_IMPORTED_MODULE_0__.retrievalURI(options);
4388
+ const baseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_7__.resolve(cwd, retrievalURI);
4380
4389
 
4381
4390
  // prepare spec for dereferencing
4382
4391
  const openApiElement = _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_8__.OpenApi3_1Element.refract(spec);
@@ -4528,7 +4537,7 @@ const retrievalURI = options => {
4528
4537
 
4529
4538
  // @TODO Swagger-UI uses baseDoc instead of url, this is to allow both
4530
4539
  // need to fix and pick one.
4531
- return baseDoc || url;
4540
+ return baseDoc || url || '';
4532
4541
  };
4533
4542
  const httpClient = options => {
4534
4543
  const {