0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 13:52:50 +01:00

Removed some vestigial code related to Range bounds checks (#20312)

This commit is contained in:
Philip Peterson 2022-07-27 23:04:36 -04:00 committed by GitHub
parent ae52df6a64
commit 4604048010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,6 @@ import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"hash"
"io"
"os"
@ -24,21 +23,6 @@ var (
ErrSizeMismatch = errors.New("Content size does not match")
)
// ErrRangeNotSatisfiable represents an error which request range is not satisfiable.
type ErrRangeNotSatisfiable struct {
FromByte int64
}
// IsErrRangeNotSatisfiable returns true if the error is an ErrRangeNotSatisfiable
func IsErrRangeNotSatisfiable(err error) bool {
_, ok := err.(ErrRangeNotSatisfiable)
return ok
}
func (err ErrRangeNotSatisfiable) Error() string {
return fmt.Sprintf("Requested range %d is not satisfiable", err.FromByte)
}
// ContentStore provides a simple file system based storage.
type ContentStore struct {
storage.ObjectStorage