fix(metadata): Ignore non-2XX HTTP responses from metadata service

This commit is contained in:
Brian Waldon
2014-03-13 21:12:14 -07:00
parent e3741a0fa3
commit c1173346c1
2 changed files with 10 additions and 1 deletions

View File

@@ -19,8 +19,12 @@ func (ms *metadataService) UserData() ([]byte, error) {
if err != nil {
return []byte{}, err
}
defer resp.Body.Close()
if resp/100 != 2 {
return []byte{}, nil
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err