diff options
author | Martin Stockhammer <martin_s@apache.org> | 2021-12-17 20:18:24 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2021-12-17 20:18:24 +0100 |
commit | 7d0aec48c3bf2663b44369612f79553553a8d19b (patch) | |
tree | 7292ee70c1b31bb6fe7e5ae6142583a5eee9225b /archiva-modules/archiva-web/archiva-webapp/src | |
parent | 8ed54feb5885857c714ecc80d466b56eaeb25818 (diff) | |
download | archiva-7d0aec48c3bf2663b44369612f79553553a8d19b.tar.gz archiva-7d0aec48c3bf2663b44369612f79553553a8d19b.zip |
[MRM-2022] Switching from beforeSend to ajax handler for header setting
Diffstat (limited to 'archiva-modules/archiva-web/archiva-webapp/src')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index c047c2da8..3f021af7e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -860,17 +860,15 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa return $.inArray(karmaName,window.redbackModel.operatioNames)>=0; }; - addValidationTokenHeader=function(user) { - if(user) { + addValidationTokenHeader = function (user) { + if (user) { if (user.validationToken) { - $.log("Adding validation token "+user.validationToken); - $.ajaxSetup({ - beforeSend: function (xhr) { - xhr.setRequestHeader('X-XSRF-TOKEN', user.validationToken); - } - }); + $.log("Adding validation token " + user.validationToken); + $(document).ajaxSend(function (ev, xhr, settings) { + xhr.setRequestHeader('X-XSRF-TOKEN', user.validationToken); + }); } else { - $.log("No validation token in user object "+user.username+", "+user.validationToken); + $.log("No validation token in user object " + user.username + ", " + user.validationToken); } } }; |