mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Fix an error in ReadableRepositoryAuthenticator when repository does not exist.
This commit is contained in:
@@ -85,8 +85,10 @@ trait ReadableRepositoryAuthenticator { self: ControllerBase with RepositoryServ
|
|||||||
private def authenticate(action: => Any) = {
|
private def authenticate(action: => Any) = {
|
||||||
{
|
{
|
||||||
val paths = request.getRequestURI.split("/")
|
val paths = request.getRequestURI.split("/")
|
||||||
val repository = getRepository(paths(1), paths(2), servletContext)
|
getRepository(paths(1), paths(2), servletContext) match {
|
||||||
if(repository.get.repository.repositoryType == RepositoryService.Public){
|
case None => NotFound()
|
||||||
|
case Some(repository) =>
|
||||||
|
if(repository.repository.repositoryType == RepositoryService.Public){
|
||||||
action
|
action
|
||||||
} else {
|
} else {
|
||||||
context.loginAccount match {
|
context.loginAccount match {
|
||||||
@@ -99,3 +101,4 @@ trait ReadableRepositoryAuthenticator { self: ControllerBase with RepositoryServ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user