Handle branch contains / properly in branch settings

This commit is contained in:
Naoki Takezoe
2020-08-23 01:11:33 +09:00
parent 8db98d7b16
commit 4d7fc061a4

View File

@@ -177,9 +177,10 @@ trait RepositorySettingsControllerBase extends ControllerBase {
})
/** Branch protection for branch */
get("/:owner/:repository/settings/branches/:branch")(ownerOnly { repository =>
get("/:owner/:repository/settings/branches/*")(ownerOnly { repository =>
import gitbucket.core.api._
val branch = params("branch")
val branch = params("splat")
if (!repository.branchList.contains(branch)) {
redirect(s"/${repository.owner}/${repository.name}/settings/branches")
} else {