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

[FIXED JENKINS-17977] [FIXED JENKINS-18032] confirmPOST needs to pass crumb #798

Merged
merged 2 commits into from Jun 19, 2013
Merged

[FIXED JENKINS-17977] [FIXED JENKINS-18032] confirmPOST needs to pass crumb #798

merged 2 commits into from Jun 19, 2013

Conversation

franciscoruiz
Copy link
Contributor

@cloudbees-pull-request-builder

core » jenkins_main_trunk #902 SUCCESS
This pull request looks good

@@ -45,6 +45,7 @@ THE SOFTWARE.
var form = document.createElement('form');
form.setAttribute('method', post ? 'POST' : 'GET');
form.setAttribute('action', href);
crumb.appendToForm(form);
Copy link
Member

Choose a reason for hiding this comment

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

Crumbs only apply to POST requests. So, try

if (post) {
    crumb.appendToForm(form);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given that only GET and POST are supported it makes sense to do it that way. I'll change it.

@jglick
Copy link
Member

jglick commented Jun 19, 2013

There are probably some other spots where a POST request is sent from AJAX without including a crumb; search *.js (and *.jelly inside <script>) for new Ajax.Request and .submit.

@cloudbees-pull-request-builder

core » jenkins_main_trunk #933 UNSTABLE
Looks like there's a problem with this pull request

jglick added a commit that referenced this pull request Jun 19, 2013
Fixed confirmPOST JS utility not working with CSRF protection enabled.
@jglick jglick merged commit 120716a into jenkinsci:master Jun 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants