Skip to content

Commit

Permalink
Merge pull request dragonflyoss#805 from ethan-daocloud/patch-3
Browse files Browse the repository at this point in the history
http_util.go: fix word in error message
  • Loading branch information
allencloud authored Aug 12, 2019
2 parents c7b2203 + df5ee18 commit b0989dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/httputils/http_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func GetRangeSE(rangeHTTPHeader string, length int64) ([]*RangeStruct, error) {
if strings.ContainsAny(rangeHTTPHeader, "=") {
rangeSlice := strings.Split(rangeHTTPHeader, "=")
if len(rangeSlice) != 2 {
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "invaild range: %s, should be like bytes=0-1023", rangeStr)
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "invalid range: %s, should be like bytes=0-1023", rangeStr)
}
rangeStr = rangeSlice[1]
}
Expand All @@ -329,7 +329,7 @@ func GetRangeSE(rangeHTTPHeader string, length int64) ([]*RangeStruct, error) {

for i := 0; i < rangeCount; i++ {
if strings.Count(rangeArr[i], "-") != 1 {
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "invaild range: %s, should be like 0-1023", rangeArr[i])
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "invalid range: %s, should be like 0-1023", rangeArr[i])
}

// -{length}
Expand Down Expand Up @@ -413,7 +413,7 @@ func handlePairRange(rangeStr string, length int64) (*RangeStruct, error) {
}

if endIndex < startIndex {
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "range: %s, the start is lager the end", rangeStr)
return nil, errors.Wrapf(errortypes.ErrInvalidValue, "range: %s, the start is larger the end", rangeStr)
}

return &RangeStruct{
Expand Down

0 comments on commit b0989dc

Please sign in to comment.