Skip to content

Commit 891a827

Browse files
authored
Support Basic Authentication for archive downloads (#35087)
Resolves #35083
1 parent 639ac00 commit 891a827

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/auth/basic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ func (b *Basic) Name() string {
4646
// name/token on successful validation.
4747
// Returns nil if header is empty or validation fails.
4848
func (b *Basic) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error) {
49-
// Basic authentication should only fire on API, Feed, Download or on Git or LFSPaths
49+
// Basic authentication should only fire on API, Feed, Download, Archives or on Git or LFSPaths
5050
// Not all feed (rss/atom) clients feature the ability to add cookies or headers, so we need to allow basic auth for feeds
5151
detector := newAuthPathDetector(req)
52-
if !detector.isAPIPath() && !detector.isFeedRequest(req) && !detector.isContainerPath() && !detector.isAttachmentDownload() && !detector.isGitRawOrAttachOrLFSPath() {
52+
if !detector.isAPIPath() && !detector.isFeedRequest(req) && !detector.isContainerPath() && !detector.isAttachmentDownload() && !detector.isArchivePath() && !detector.isGitRawOrAttachOrLFSPath() {
5353
return nil, nil
5454
}
5555

0 commit comments

Comments
 (0)