mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
check response status header // cancel update // return error if response non equal http.StatusOK
This commit is contained in:
parent
bffcb11cf9
commit
0b70758b0b
@ -49,6 +49,9 @@ func Get(URL string, obj interface{}) {
|
||||
fmt.Printf("%s", err)
|
||||
} else {
|
||||
defer response.Body.Close()
|
||||
if response.StatusCode != http.StatusOK {
|
||||
fmt.Errorf("Bad HTTP Response: %v", response.Status)
|
||||
}
|
||||
contents, err := ioutil.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
fmt.Printf("%s", err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user