diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index f11ecec..101672a 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -834,52 +834,37 @@ /** * Download repository contents as a zip archive as compatible URL. */ - get("/:owner/:repository/archive/:branch.zip")(referrersOnly { repository => + get("/:owner/:repository/archive/*/:branch.zip")(referrersOnly { repository => val branch = params("branch") - archiveRepository(branch, branch + ".zip", repository, "") + val path = multiParams("splat").head + archiveRepository(branch, branch + ".zip", repository, path) }) /** * Download repository contents as a tar.gz archive as compatible URL. */ - get("/:owner/:repository/archive/:branch.tar.gz")(referrersOnly { repository => + get("/:owner/:repository/archive/*/:branch.tar.gz")(referrersOnly { repository => val branch = params("branch") - archiveRepository(branch, branch + ".tar.gz", repository, "") + val path = multiParams("splat").head + archiveRepository(branch, branch + ".tar.gz", repository, path) }) /** * Download repository contents as a tar.bz2 archive as compatible URL. */ - get("/:owner/:repository/archive/:branch.tar.bz2")(referrersOnly { repository => + get("/:owner/:repository/archive/*/:branch.tar.bz2")(referrersOnly { repository => val branch = params("branch") - archiveRepository(branch, branch + ".tar.bz2", repository, "") + val path = multiParams("splat").head + archiveRepository(branch, branch + ".tar.bz2", repository, path) }) /** * Download repository contents as a tar.xz archive as compatible URL. */ - get("/:owner/:repository/archive/:branch.tar.xz")(referrersOnly { repository => + get("/:owner/:repository/archive/*/:branch.tar.xz")(referrersOnly { repository => val branch = params("branch") - archiveRepository(branch, branch + ".tar.xz", repository, "") - }) - - /** - * Download all repository contents as an archive. - */ - get("/:owner/:repository/archive/:branch/:name")(referrersOnly { repository => - val branch = params("branch") - val name = params("name") - archiveRepository(branch, name, repository, "") - }) - - /** - * Download repositories subtree contents as an archive. - */ - get("/:owner/:repository/archive/:branch/*/:name")(referrersOnly { repository => - val branch = params("branch") - val name = params("name") val path = multiParams("splat").head - archiveRepository(branch, name, repository, path) + archiveRepository(branch, branch + ".tar.xz", repository, path) }) get("/:owner/:repository/network/members")(referrersOnly { repository => diff --git a/src/main/twirl/gitbucket/core/repo/files.scala.html b/src/main/twirl/gitbucket/core/repo/files.scala.html index 877411f..057b387 100644 --- a/src/main/twirl/gitbucket/core/repo/files.scala.html +++ b/src/main/twirl/gitbucket/core/repo/files.scala.html @@ -33,7 +33,7 @@