Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Revert unnecessary changes to Fine Uploader. The csrf-token can be passe... #159

Merged
merged 1 commit into from

2 participants

@markotibold

...d as another parameter.

This was pointed out to me by one of the maintainers of Fine Uploader.

@dbunskoek dbunskoek merged commit 1e3d7d9 into ridethepony:dev

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2013
  1. @markotibold

    Revert unnecessary changes to Fine Uploader. The csrf-token can be pa…

    markotibold authored
    …ssed as another parameter.
    
    Thanks @micholus.
This page is out of date. Refresh to see the latest.
View
11 fiber/static/fiber/js/admin.js
@@ -675,15 +675,10 @@ var BaseFileSelectDialog = AdminRESTDialog.extend({
endpoint: this.get_upload_path(),
inputName: this.get_upload_fieldname(),
params: {
- 'title': this.get_upload_fieldname()
- },
- paramsInBody: true,
- customHeaders: {
- "X-CSRFToken": getCookie('csrftoken')
- },
- customFields: {
+ 'title': this.get_upload_fieldname(),
"csrfmiddlewaretoken": getCookie('csrftoken')
- }
+ },
+ paramsInBody: true
}
});
View
12 fiber/static/fiber/js/file-uploader-3.2.0/client/js/handler.form.js
@@ -103,8 +103,7 @@ qq.UploadHandlerForm = function(o, uploadCompleteCallback, logCallback) {
protocol = options.demoMode ? "GET" : "POST",
form = qq.toElement('<form method="' + protocol + '" enctype="multipart/form-data"></form>'),
endpoint = options.endpointStore.getEndpoint(id),
- url = endpoint,
- extraFields = options.customFields;
+ url = endpoint;
params[options.uuidParamName] = uuids[id];
@@ -118,15 +117,6 @@ qq.UploadHandlerForm = function(o, uploadCompleteCallback, logCallback) {
form.setAttribute('action', url);
form.setAttribute('target', iframe.name);
form.style.display = 'none';
-
- // Add csrf token to the form
- qq.each(extraFields, function(name, val) {
- var input;
- input = document.createElement('input');
- input.setAttribute('name', name);
- input.setAttribute('value', val);
- form.appendChild(input);
- });
document.body.appendChild(form);
return form;
View
1  fiber/static/fiber/js/file-uploader-3.2.0/client/js/uploader.basic.js
@@ -12,7 +12,6 @@ qq.FineUploaderBasic = function(o){
params: {},
paramsInBody: false,
customHeaders: {},
- customFields: {},
forceMultipart: true,
inputName: 'qqfile',
uuidName: 'qquuid',
Something went wrong with that request. Please try again.