mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 21:15:49 +01:00
Fix downloading branch that contains slash (#3825)
This commit is contained in:
@@ -1076,14 +1076,9 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
|||||||
redirect(s"${repository.owner}/${repository.name}/releases")
|
redirect(s"${repository.owner}/${repository.name}/releases")
|
||||||
})
|
})
|
||||||
|
|
||||||
get("/:owner/:repository/archive/:name")(referrersOnly { repository =>
|
get("/:owner/:repository/archive/*")(referrersOnly { repository =>
|
||||||
val name = params("name")
|
val name = multiParams("splat").mkString("/")
|
||||||
archiveRepository(name, repository, "")
|
val path = params.get("path").getOrElse("")
|
||||||
})
|
|
||||||
|
|
||||||
get("/:owner/:repository/archive/*/:name")(referrersOnly { repository =>
|
|
||||||
val name = params("name")
|
|
||||||
val path = multiParams("splat").head
|
|
||||||
archiveRepository(name, repository, path)
|
archiveRepository(name, repository, path)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="head" style="height: 24px;">
|
<div class="head" style="height: 24px;">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a href="@{helpers.url(repository)}/archive@if(pathList.length > 0){/@pathList.map(helpers.urlEncode).mkString("/")}/@{helpers.urlEncode(branch)}.zip" class="btn btn-sm btn-default pc"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
|
<a href="@{helpers.url(repository)}/archive/@{helpers.urlEncode(branch)}.zip@if(pathList.nonEmpty){?path=@helpers.urlEncode(pathList.mkString("/"))}" class="btn btn-sm btn-default pc"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
|
||||||
<a href="@helpers.url(repository)/find/@helpers.encodeRefName(branch)" class="btn btn-sm btn-default" data-hotkey="t" title="Search files"><i class="octicon octicon-search" aria-label="Search files"></i></a>
|
<a href="@helpers.url(repository)/find/@helpers.encodeRefName(branch)" class="btn btn-sm btn-default" data-hotkey="t" title="Search files"><i class="octicon octicon-search" aria-label="Search files"></i></a>
|
||||||
<a href="@helpers.url(repository)/commits/@helpers.encodeRefName((branch :: pathList).mkString("/"))" class="btn btn-sm btn-default"><i class="octicon octicon-history"></i> @if(commitCount > 10000){10000+} else {@commitCount} @helpers.plural(commitCount, "commit")</a>
|
<a href="@helpers.url(repository)/commits/@helpers.encodeRefName((branch :: pathList).mkString("/"))" class="btn btn-sm btn-default"><i class="octicon octicon-history"></i> @if(commitCount > 10000){10000+} else {@commitCount} @helpers.plural(commitCount, "commit")</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user