@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.
@@ -988,10 +988,21 @@
988
988
  }
989
989
  headers['X-Requested-With'] = 'XMLHttpRequest';
990
990
  if (csrfToken === null) {
991
- headers['CSRF-Token'] = document.cookie.split(';').find(( /**
991
+ if (document.cookie.split(';').find(( /**
992
992
  * @param {?} row
993
993
  * @return {?}
994
- */function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
994
+ */function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1] !== undefined) {
995
+ headers['CSRF-Token'] = document.cookie.split(';').find(( /**
996
+ * @param {?} row
997
+ * @return {?}
998
+ */function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1];
999
+ }
1000
+ else {
1001
+ headers['CSRF-Token'] = document.cookie.split(';').find(( /**
1002
+ * @param {?} row
1003
+ * @return {?}
1004
+ */function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
1005
+ }
995
1006
  }
996
1007
  else {
997
1008
  headers['CSRF-Token'] = csrfToken.content;
@@ -1956,10 +1967,21 @@
1956
1967
  }
1957
1968
  headers['X-Requested-With'] = 'XMLHttpRequest';
1958
1969
  if (csrfToken.content === null) {
1959
- headers['CSRF-Token'] = document.cookie.split(';').find(( /**
1970
+ if (document.cookie.split(';').find(( /**
1960
1971
  * @param {?} row
1961
1972
  * @return {?}
1962
- */function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
1973
+ */function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1] !== undefined) {
1974
+ headers['CSRF-Token'] = document.cookie.split(';').find(( /**
1975
+ * @param {?} row
1976
+ * @return {?}
1977
+ */function (row) { return row.startsWith('XSRF-TOKEN'); })).split('=')[1];
1978
+ }
1979
+ else {
1980
+ headers['CSRF-Token'] = document.cookie.split(';').find(( /**
1981
+ * @param {?} row
1982
+ * @return {?}
1983
+ */function (row) { return row.startsWith(' XSRF-TOKEN'); })).split('=')[1];
1984
+ }
1963
1985
  }
1964
1986
  else {
1965
1987
  headers['CSRF-Token'] = csrfToken.content;