Add CSRF check for task and project files upload

This commit is contained in:
Frédéric Guillot
2018-01-29 15:56:30 -08:00
parent 90984d6bb9
commit 9ddefa979a
13 changed files with 71 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ KB.component('file-upload', function (containerElement, options) {
currentFileIndex++;
if (currentFileIndex < files.length) {
KB.http.uploadFile(options.url, files[currentFileIndex], onProgress, onComplete, onError, onServerError);
KB.http.uploadFile(options.url, files[currentFileIndex], options.csrf, onProgress, onComplete, onError, onServerError);
} else {
KB.trigger('modal.stop');
KB.trigger('modal.hide');
@@ -92,7 +92,7 @@ KB.component('file-upload', function (containerElement, options) {
function uploadFiles() {
if (files.length > 0) {
KB.http.uploadFile(options.url, files[currentFileIndex], onProgress, onComplete, onError, onServerError);
KB.http.uploadFile(options.url, files[currentFileIndex], options.csrf, onProgress, onComplete, onError, onServerError);
}
}