aboutsummaryrefslogtreecommitdiffstats
path: root/modules/lfs/server.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-11-01 04:51:48 +0800
committerGitHub <noreply@github.com>2020-10-31 16:51:48 -0400
commite4e85a3e51066f4987a87762c9c69acda093f6ca (patch)
tree14c00ee9e19dcec4ac2a93e6b5a0f0ec343f824c /modules/lfs/server.go
parente7750e0f6a4fb032bb0f717caf2b8a10a6ede873 (diff)
downloadgitea-e4e85a3e51066f4987a87762c9c69acda093f6ca.tar.gz
gitea-e4e85a3e51066f4987a87762c9c69acda093f6ca.zip
Storage configuration support `[storage]` (#13314)
* Fix minio bug * Add tests for storage configuration * Change the Seek flag to keep compitable minio? * Fix test when first-byte-pos of all ranges is greater than the resource length Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/lfs/server.go')
-rw-r--r--modules/lfs/server.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/lfs/server.go b/modules/lfs/server.go
index 2801f8410c..b093213643 100644
--- a/modules/lfs/server.go
+++ b/modules/lfs/server.go
@@ -191,8 +191,12 @@ func getContentHandler(ctx *context.Context) {
contentStore := &ContentStore{ObjectStorage: storage.LFS}
content, err := contentStore.Get(meta, fromByte)
if err != nil {
- // Errors are logged in contentStore.Get
- writeStatus(ctx, 404)
+ if IsErrRangeNotSatisfiable(err) {
+ writeStatus(ctx, http.StatusRequestedRangeNotSatisfiable)
+ } else {
+ // Errors are logged in contentStore.Get
+ writeStatus(ctx, 404)
+ }
return
}
defer content.Close()