diff --git a/hab/hab.go b/hab/hab.go index 759bd7f..98d7685 100644 --- a/hab/hab.go +++ b/hab/hab.go @@ -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) } diff --git a/hab/hab_test.go b/hab/hab_test.go index dccf219..928a159 100644 --- a/hab/hab_test.go +++ b/hab/hab_test.go @@ -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, }, @@ -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, },