@hmcts/ccpay-web-component 5.0.2 → 5.0.3

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.
@@ -968,11 +968,24 @@ var WebComponentHttpClient = /** @class */ (function () {
968
968
  }
969
969
  headers['X-Requested-With'] = 'XMLHttpRequest';
970
970
  if (csrfToken === null) {
971
- headers['CSRF-Token'] = document.cookie.split(';').find((/**
971
+ if (document.cookie.split(';').find((/**
972
972
  * @param {?} row
973
973
  * @return {?}
974
974
  */
975
- function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
975
+ function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1] !== undefined) {
976
+ headers['CSRF-Token'] = document.cookie.split(';').find((/**
977
+ * @param {?} row
978
+ * @return {?}
979
+ */
980
+ function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1];
981
+ }
982
+ else {
983
+ headers['CSRF-Token'] = document.cookie.split(';').find((/**
984
+ * @param {?} row
985
+ * @return {?}
986
+ */
987
+ function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
988
+ }
976
989
  }
977
990
  else {
978
991
  headers['CSRF-Token'] = csrfToken.content;
@@ -1946,11 +1959,24 @@ var RefundsService = /** @class */ (function () {
1946
1959
  }
1947
1960
  headers['X-Requested-With'] = 'XMLHttpRequest';
1948
1961
  if (csrfToken.content === null) {
1949
- headers['CSRF-Token'] = document.cookie.split(';').find((/**
1962
+ if (document.cookie.split(';').find((/**
1950
1963
  * @param {?} row
1951
1964
  * @return {?}
1952
1965
  */
1953
- function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
1966
+ function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1] !== undefined) {
1967
+ headers['CSRF-Token'] = document.cookie.split(';').find((/**
1968
+ * @param {?} row
1969
+ * @return {?}
1970
+ */
1971
+ function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1];
1972
+ }
1973
+ else {
1974
+ headers['CSRF-Token'] = document.cookie.split(';').find((/**
1975
+ * @param {?} row
1976
+ * @return {?}
1977
+ */
1978
+ function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
1979
+ }
1954
1980
  }
1955
1981
  else {
1956
1982
  headers['CSRF-Token'] = csrfToken.content;