contentful-management 7.5.1 → 7.5.2

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [7.5.1](https://github.com/contentful/contentful-management.js/compare/v7.5.0...v7.5.1) (2020-12-17)
1
+ ## [7.5.2](https://github.com/contentful/contentful-management.js/compare/v7.5.1...v7.5.2) (2021-01-19)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * allow required headers to be overwritten by custom ones ([#609](https://github.com/contentful/contentful-management.js/issues/609)) ([73e95ce](https://github.com/contentful/contentful-management.js/commit/73e95ce0db745decff1bee7a3ed07d9e4c9f9540))
6
+ * check for undefined config in error handler ([#644](https://github.com/contentful/contentful-management.js/issues/644)) ([da6c59a](https://github.com/contentful/contentful-management.js/commit/da6c59a64629ae7227de11acc4fe0760123f803a))
@@ -4335,7 +4335,7 @@ function createCMAHttpClient(params) {
4335
4335
  var plainClient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4336
4336
  var sdkMain = plainClient ? 'contentful-management-plain.js' : 'contentful-management.js';
4337
4337
  var userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])( // @ts-expect-error
4338
- "".concat(sdkMain, "/").concat("7.5.1"), params.application, params.integration, params.feature);
4338
+ "".concat(sdkMain, "/").concat("7.5.2"), params.application, params.integration, params.feature);
4339
4339
  var requiredHeaders = {
4340
4340
  'Content-Type': 'application/vnd.contentful.management.v1+json',
4341
4341
  'X-Contentful-User-Agent': userAgentHeader
@@ -9761,7 +9761,7 @@ function errorHandler(errorResponse) {
9761
9761
  response = errorResponse.response;
9762
9762
  var errorName; // Obscure the Management token
9763
9763
 
9764
- if (config.headers && config.headers['Authorization']) {
9764
+ if (config && config.headers && config.headers['Authorization']) {
9765
9765
  var token = "...".concat(config.headers['Authorization'].substr(-5));
9766
9766
  config.headers['Authorization'] = "Bearer ".concat(token);
9767
9767
  }