diff --git a/core/js/oc-requesttoken.js b/core/js/oc-requesttoken.js index d5dcecdb5aba8..cc0753c9924dd 100644 --- a/core/js/oc-requesttoken.js +++ b/core/js/oc-requesttoken.js @@ -4,3 +4,13 @@ $(document).on('ajaxSend',function(elm, xhr, settings) { xhr.setRequestHeader('OCS-APIREQUEST', 'true'); } }); + +(function () { + var originalFetch = window.fetch; + window.fetch = function(input, init) { + init = init || {}; + init.headers = init.headers || {}; + init.headers.requesttoken = oc_requesttoken; + return originalFetch(input, init); + } +})();