mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7124 - [SECU] Cross-Site Request Forgery (CSRF) in several iTop pages (finalize implementation)
This commit is contained in:
17
js/utils.js
17
js/utils.js
@@ -1296,6 +1296,23 @@ const CombodoInlineImage = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Abstract Fetch API wrapper to manage AJAX requests in iTop.
|
||||
*/
|
||||
const CombodoHTTP = {
|
||||
/**
|
||||
* @param {string} sUrl URL to fetch
|
||||
* @param {Object} oOptions Fetch options
|
||||
* @return {Promise<Response>}
|
||||
*/
|
||||
Fetch: function(sUrl, oOptions) {
|
||||
oOptions = oOptions || {};
|
||||
oOptions.headers = oOptions.headers || {};
|
||||
oOptions.headers['X-Combodo-Ajax'] = true;
|
||||
return fetch(sUrl, oOptions);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract wrapper to manage modal dialogs in iTop.
|
||||
* Implementations for the various GUIs may vary but APIs are the same.
|
||||
|
||||
Reference in New Issue
Block a user