Skip to content

Commit

Permalink
fix(#146): handle proper response code range for max allowed size
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Jul 28, 2017
1 parent 86c6dd6 commit 344b691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source_http.go
Expand Up @@ -42,7 +42,7 @@ func (s *HttpImageSource) fetchImage(url *url.URL, ireq *http.Request) ([]byte,
return nil, fmt.Errorf("Error fetching image http headers: %v", err)
}
res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode <= 206 {
if res.StatusCode < 200 && res.StatusCode > 206 {
return nil, fmt.Errorf("Error fetching image http headers: (status=%d) (url=%s)", res.StatusCode, req.URL.String())
}

Expand Down

0 comments on commit 344b691

Please sign in to comment.