stable

Clone or download

Read-only

request #12618: Jenkins webhook might fail when the server URL ends with /

If a user gives an URL ending with a / Tuleap will try to to notify the Jenkins instance via an URL looking like https://jenkins.example.com//git/notifyCommit. Due to the // in the URL, Jenkins will not apply the same CSRF checks than for https://jenkins.example.com/git/notifyCommit and the notification request can be rejected with a forbidden error due to incorrect CSRF token. The issue can be reproduced with a Jenkins instance not accessible to anonymous users with the CSRF checks enabled. Change-Id: I6241e81c5fbea1337c85023dc806baa4ca2743ea

Modified Files

Name
M plugins/hudson_git/include/HudsonGit/Hook/JenkinsClient.php +3 −0 Go to diff View file
M src/common/Jenkins/Client.class.php +5 −1 Go to diff View file
M src/common/Jenkins/JenkinsCSRFCrumbRetriever.php +4 −0 Go to diff View file
A tests/phpunit/common/Jenkins/JenkinsCSRFCrumbRetrieverTest.php +65 −0 Go to diff View file
D tests/simpletest/common/Jenkins/JenkinsCSRFCrumbRetrieverTest.php +0 −51 Go to diff View file