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) = {
|
||||
{
|
||||
val paths = request.getRequestURI.split("/")
|
||||
val repository = getRepository(paths(1), paths(2), servletContext)
|
||||
if(repository.get.repository.repositoryType == RepositoryService.Public){
|
||||
getRepository(paths(1), paths(2), servletContext) match {
|
||||
case None => NotFound()
|
||||
case Some(repository) =>
|
||||
if(repository.repository.repositoryType == RepositoryService.Public){
|
||||
action
|
||||
} else {
|
||||
context.loginAccount match {
|
||||
@@ -98,4 +100,5 @@ trait ReadableRepositoryAuthenticator { self: ControllerBase with RepositoryServ
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user