swagger-client 3.19.4 → 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,