diff options
Diffstat (limited to 'services/lfs/server.go')
-rw-r--r-- | services/lfs/server.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/lfs/server.go b/services/lfs/server.go index 44de9ba74f..4c69e47512 100644 --- a/services/lfs/server.go +++ b/services/lfs/server.go @@ -86,6 +86,11 @@ 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 @@ -360,6 +365,11 @@ 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) @@ -423,6 +433,11 @@ func getAuthenticatedRepository(ctx *context.Context, rc *requestContext, requir return nil } + context.CheckRepoScopedToken(ctx, repository) + if ctx.Written() { + return nil + } + return repository } |