[ 
https://issues.apache.org/jira/browse/MRM-2022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cristian Onet updated MRM-2022:
-------------------------------
    Description: This is caused by the fact that X-XSRF-TOKEN is set by a 
handler setup using ajaxSetup that is overwritten by beforeSend I worked around 
it using the attached [^archiva.patch]  (was: This is caused by the fact that 
X-XSRF-TOKEN is set by a handler setup using ajaxSetup that is overwritten by 
beforeSend I worked around it using this:

 
{quote}--- /archiva/apps/archiva/js/archiva/main.js.bck

+++ /archiva/apps/archiva/js/archiva/main.js

@@ -864,11 +864,9 @@

     if(user) {

       if (user.validationToken) {

         $.log("Adding validation token "+user.validationToken);

-        $.ajaxSetup({

-                      beforeSend: function (xhr) {

+        $(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);

       }
{quote})

> beforeSend overwrite prevents repository scan trigger
> -----------------------------------------------------
>
>                 Key: MRM-2022
>                 URL: https://issues.apache.org/jira/browse/MRM-2022
>             Project: Archiva
>          Issue Type: Bug
>          Components: repository scanning
>    Affects Versions: 2.2.5
>            Reporter: Cristian Onet
>            Priority: Trivial
>         Attachments: archiva.patch
>
>
> This is caused by the fact that X-XSRF-TOKEN is set by a handler setup using 
> ajaxSetup that is overwritten by beforeSend I worked around it using the 
> attached [^archiva.patch]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to