Skip to content

Commit 962a063

Browse files
committed
Fix sessionFixation test
1 parent df16ae3 commit 962a063

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/test/java/org/jenkinsci/plugins/GithubAccessTokenPropertySEC797Test.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ private void onUserTeams(HttpServletRequest req, HttpServletResponse resp) throw
249249

250250
private void onLoginOAuthAuthorize(HttpServletRequest req, HttpServletResponse resp) throws IOException {
251251
String code = "test";
252-
resp.sendRedirect(jenkinsRule.getURL() + "securityRealm/finishLogin?code=" + code);
252+
String state = req.getParameter("state");
253+
resp.sendRedirect(jenkinsRule.getURL() + "securityRealm/finishLogin?code=" + code + "&state=" + state);
253254
}
254255

255256
private void onLoginOAuthAccessToken(HttpServletRequest req, HttpServletResponse resp) throws IOException {

src/test/java/org/jenkinsci/plugins/GithubAccessTokenPropertyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ private void onUserTeams(HttpServletRequest req, HttpServletResponse resp) throw
246246
private void onLoginOAuthAuthorize(HttpServletRequest req, HttpServletResponse resp) throws IOException {
247247
String code = "test";
248248
String state = req.getParameter("state");
249-
resp.sendRedirect(jenkinsRule.getURL() + "securityRealm/finishLogin?code=" + code+"&state="+state);
249+
resp.sendRedirect(jenkinsRule.getURL() + "securityRealm/finishLogin?code=" + code + "&state=" + state);
250250
}
251251

252252
private void onLoginOAuthAccessToken(HttpServletRequest req, HttpServletResponse resp) throws IOException {

0 commit comments

Comments
 (0)