[Bps-public-commit] rt-extension-todolist branch, devel, created. d735e493dfd49bd86af388b5bf1a539df5c8a233

Craig Kaiser craig at bestpractical.com
Tue Apr 30 17:00:07 EDT 2019


The branch, devel has been created
        at  d735e493dfd49bd86af388b5bf1a539df5c8a233 (commit)

- Log -----------------------------------------------------------------
commit d735e493dfd49bd86af388b5bf1a539df5c8a233
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Tue Apr 30 16:57:56 2019 -0400

    Include credentials on fetch call
    
    By default some older browsers do not send the crendentials of the current
    page to the requested one. This will result in a 302 response from RT.

diff --git a/static/js/rt-extension-todolist.js b/static/js/rt-extension-todolist.js
index b2d2af5..e2db016 100644
--- a/static/js/rt-extension-todolist.js
+++ b/static/js/rt-extension-todolist.js
@@ -1,6 +1,7 @@
 function UpdateTodoList (Object) {
     const CustomField = jQuery('#RT-TodoList-Select').val();
     fetch(RT.Config.WebHomePath + "/Helpers/TodoList?UpdateTodoList=1&ObjectId="+Object+"&CustomField="+CustomField, {
+       credentials: 'include',
     }).then(response => (response.json()))
     .then(json => {
           jQuery('#RT-TodoList').html(json[0].html)
@@ -22,10 +23,7 @@ function UpdateTodos () {
     values['UpdateTodo'] = 1;
     fetch(RT.Config.WebHomePath + "/Helpers/TodoList", {
         method: 'POST',
-        headers: {
-        'Accept': 'application/json',
-        'Content-Type': 'application/json'
-        },
+        credentials: 'include',
         body: JSON.stringify(values)
     });
 };

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list