aboutsummaryrefslogtreecommitdiffstats
path: root/services/auth/auth.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-09-02 16:48:48 +0100
committerGitHub <noreply@github.com>2021-09-02 16:48:48 +0100
commita75b2f2842e3bfa462da4d205194a59824c2dde8 (patch)
treed17724696e6e5a1c4b2ad87323817d9296fe8578 /services/auth/auth.go
parent268b2d0c91fe7ff792ba22df5e11d34446224fb6 (diff)
downloadgitea-a75b2f2842e3bfa462da4d205194a59824c2dde8.tar.gz
gitea-a75b2f2842e3bfa462da4d205194a59824c2dde8.zip
Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916)
Duplicate #15987 to allow access to releases download through BASIC authentication. Fix #16914 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'services/auth/auth.go')
-rw-r--r--services/auth/auth.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/auth/auth.go b/services/auth/auth.go
index 11a8c6ed1c..eb78cfdcce 100644
--- a/services/auth/auth.go
+++ b/services/auth/auth.go
@@ -90,11 +90,11 @@ func isAttachmentDownload(req *http.Request) bool {
return strings.HasPrefix(req.URL.Path, "/attachments/") && req.Method == "GET"
}
-var gitRawPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|raw/)`)
+var gitRawReleasePathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/(?:(?:git-(?:(?:upload)|(?:receive))-pack$)|(?:info/refs$)|(?:HEAD$)|(?:objects/)|(?:raw/)|(?:releases/download/))`)
var lfsPathRe = regexp.MustCompile(`^/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/info/lfs/`)
-func isGitRawOrLFSPath(req *http.Request) bool {
- if gitRawPathRe.MatchString(req.URL.Path) {
+func isGitRawReleaseOrLFSPath(req *http.Request) bool {
+ if gitRawReleasePathRe.MatchString(req.URL.Path) {
return true
}
if setting.LFS.StartServer {