Skip to content

Commit

Permalink
fix: Fix to receive partial contents (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yoshika authored and tkyi committed Aug 14, 2018
1 parent 51f6a9c commit fcb48cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hab/hab.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (depo *depot) packagesInfo(pkgName string, from int) (PackagesInfo, error)

if res.StatusCode == 404 {
return PackagesInfo{}, errors.New("Package not found")
} else if res.StatusCode != 200 {
} else if res.StatusCode/100 != 2 {
return PackagesInfo{}, fmt.Errorf("Unexpected status code: %d", res.StatusCode)
}

Expand Down
4 changes: 2 additions & 2 deletions hab/hab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func TestPackagesInfoFromName(t *testing.T) {
},
},
expected: []string{"0.0.1", "0.0.2", "0.1.0", "0.1.1", "1.0.0"},
statusCode: 200,
statusCode: 206,
httpError: nil,
expectedError: nil,
},
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestPackagesInfoFromName(t *testing.T) {
},
},
expected: []string{"0.0.1", "0.0.2", "0.1.0", "0.1.1", "1.0.0", "1.0.1", "1.1.0", "2.0.0"},
statusCode: 200,
statusCode: 206,
httpError: nil,
expectedError: nil,
},
Expand Down

0 comments on commit fcb48cf

Please sign in to comment.