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

Use util function for upload to add authentication #831

Merged
merged 2 commits into from
Jan 6, 2017

Conversation

juhasch
Copy link
Member

@juhasch juhasch commented Jan 4, 2017

Fix dragdrop extension due to security fix jupyter/notebook#2005

Should fix #830

@@ -73,15 +73,14 @@ define([
data : JSON.stringify(data),
headers : {'Content-Type': 'text/plain'},
async : false,
success : function (data, status, xhr) {
error : function() {console.log('Data transfer for drag-and-drop failed.'); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will get ignored - see notebook/static/base/js/utils.js#L718

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want instead a

utils.promising_ajax(url, settings).then(
    function on_success (data, status, xhr) {/*...*/},
    function on_error (reason) {/*...*/}
);

pattern

@juhasch
Copy link
Member Author

juhasch commented Jan 6, 2017

I think I only copied the usage pattern from somewhere else. But you are right and I also should add the error path that is unused now.

@juhasch juhasch merged commit bc53717 into ipython-contrib:master Jan 6, 2017
@juhasch juhasch deleted the fix/dragdrop branch January 6, 2017 17:15
@juhasch juhasch restored the fix/dragdrop branch January 6, 2017 22:05
@juhasch juhasch deleted the fix/dragdrop branch January 6, 2017 22:07
@juhasch juhasch restored the fix/dragdrop branch January 8, 2017 15:13
@juhasch juhasch deleted the fix/dragdrop branch March 26, 2017 17:14
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

Successfully merging this pull request may close these issues.

Drag-and-drop plugin fails with "'_xrsf' missing from POST"
2 participants