angular-ui/ui-utils

Provider for configuring ui-uploader HTTP headers / using $http instead XMLHttpRequest

dunmaksim opened this issue · 1 comments

Hello!
I began using ui.uploader, but Django REST Framework decline all requests with message

{
    "detail": "CSRF Failed: CSRF token missing or incorrect."
}

I saw the source code and find, what this module not uses $http for own work, and all my settings in app.run() not included to result request body:

Application.run(['$http', '$cookies', function($http, $cookies) {
    $http.defaults.headers.common['X-CSRFToken'] = $cookies.csrftoken;
    $http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
    // Used in $resource and $http, but not in ui.uploader
}]);

Please, create provider for ui-uploader or rewrite ajaxUpload() function with $http.
Also, I not found way for setting X-CSRFToken with options property of ui.uploader.
Excuse my typing errors, English is not my native language.

UI.Utils modules was split in individuals repositories. If still valid, please consider re-submitting the issue on its dedicated issue tracker.

See the README for details.