Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

http_util.go: fix word in error message #805

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that there are two places in this file, which has the same incorrect spelling.
Could you help to fix that in this single pull request? @ethan-daocloud

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I will find and fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allencloud
And I check this file thoroughly, find one more , please confirm :)

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