Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Fix urth-core-import package issue #549

Merged
merged 1 commit into from
Mar 27, 2017
Merged

Fix urth-core-import package issue #549

merged 1 commit into from
Mar 27, 2017

Conversation

haobibo
Copy link
Contributor

@haobibo haobibo commented Mar 16, 2017

Replacement for #542 and #542

This PR fix issue mentioned in #538 by adding a XSRF filed in post
request header.

Replacement for #542 and #542

This PR fix issue mentioned in #538 by adding a XSRF filed in post
request header.
@haobibo
Copy link
Contributor Author

haobibo commented Mar 23, 2017

any comments?
Jupyter Notebook now provides a function Jupyter.utils.ajax to ensure X-XSRFToken is in AJAX request header.

@lbustelo
Copy link
Collaborator

I think the fix here is better for backwards compat. The only issue is that we don't have our tests running against 4.3 and so I have not way of testing this.

@lbustelo lbustelo merged commit d342274 into jupyter:master Mar 27, 2017
@jpizarrom
Copy link

jpizarrom commented Aug 16, 2017

the name should be cookie name

            var r = document.cookie.match("\\b" + "_xsrf" + "=([^;]*)\\b");
            r = r ? r[1] : undefined;
            if(r){
                if (!this.$.ajaxPost.headers) {
                    this.$.ajaxPost.headers = {};
                }
                this.$.ajaxPost.headers['X-XSRFToken'] = r;
            }

cc @lbustelo

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

Successfully merging this pull request may close these issues.

3 participants