mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix auth check bug (#24382)
Fix https://github.com/go-gitea/gitea/pull/24362/files#r1179095324 `getAuthenticatedMeta` has checked them, these code are duplicated one. And the first invokation has a wrong permission check. `DownloadHandle` should require read permission but not write.
This commit is contained in:
		@@ -86,11 +86,6 @@ func DownloadHandler(ctx *context.Context) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	repository := getAuthenticatedRepository(ctx, rc, true)
 | 
			
		||||
	if repository == nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Support resume download using Range header
 | 
			
		||||
	var fromByte, toByte int64
 | 
			
		||||
	toByte = meta.Size - 1
 | 
			
		||||
@@ -365,11 +360,6 @@ func VerifyHandler(ctx *context.Context) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	repository := getAuthenticatedRepository(ctx, rc, true)
 | 
			
		||||
	if repository == nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	contentStore := lfs_module.NewContentStore()
 | 
			
		||||
	ok, err := contentStore.Verify(meta.Pointer)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user