1
0
Fork 0
forked from forgejo/forgejo

Fix attachment download bug (#27486)

This commit is contained in:
Lunny Xiao 2023-10-10 23:33:56 +08:00 committed by GitHub
parent 7ff1f2527c
commit 5c9fbcca00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 21 deletions

View file

@ -127,7 +127,7 @@ func (o *OAuth2) userIDFromToken(ctx context.Context, tokenSHA string, store Dat
func (o *OAuth2) Verify(req *http.Request, w http.ResponseWriter, store DataStore, sess SessionStore) (*user_model.User, error) {
// These paths are not API paths, but we still want to check for tokens because they maybe in the API returned URLs
if !middleware.IsAPIPath(req) && !isAttachmentDownload(req) && !isAuthenticatedTokenRequest(req) &&
!gitRawReleasePathRe.MatchString(req.URL.Path) {
!isGitRawOrAttachPath(req) {
return nil, nil
}