Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers do not appear to be getting set for request from iFrame #5

Closed
pjfreeze opened this issue Jan 23, 2015 · 3 comments
Closed

Headers do not appear to be getting set for request from iFrame #5

pjfreeze opened this issue Jan 23, 2015 · 3 comments

Comments

@pjfreeze
Copy link

I am using flow and falling back to fusty-flow for uploading images in an angularjs application, using ng-flow. I am providing the flow-init attribute the object specifying options and the header property with the keys and values I need set to support csrf auth.

Following is the object I provide the flow-init which following the code through shows it gets passed property to fusty flow:

$scope.initSettings = {
    headers: {
        'X-CSRFToken': Cookies.get('csrftoken'),
        'Authorization': $scope.user.getAuthToken()
    }
};

I've looked over flowjs/ng-flow#82 and understand I need to set them for every request, but when viewing the request headers in IE9, the headers have not been set.

@AidasK
Copy link
Member

AidasK commented Jan 24, 2015

For fusty flow you have to use query or post params to pass csrf token, because files are uploaded through iframe and there is no way you can set custom headers.

@AidasK AidasK closed this as completed Jan 24, 2015
@pjfreeze
Copy link
Author

@AidasK Thanks for the quick response.

@guymoyo
Copy link

guymoyo commented Aug 16, 2015

thx, it works for me:

headers: function (file, chunk, isTest) {
return {
'X-CSRF-TOKEN': $cookies.get("CSRF-TOKEN")// call func for getting a cookie
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants