mirror of https://github.com/k3s-io/k3s
use status code const to express http status
parent
48536eaef9
commit
ee6568a52a
|
@ -263,7 +263,7 @@ func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts
|
|||
}
|
||||
|
||||
// Error - Set the error condition from the StatusCode
|
||||
if statusCode != 200 {
|
||||
if statusCode != http.StatusOK {
|
||||
err = fmt.Errorf("unable to read URL %q, server reported %s, status code=%d", u, status, statusCode)
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ func (s *sourceURL) extractFromURL() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("%v: %v", s.url, resp.Status)
|
||||
}
|
||||
if len(data) == 0 {
|
||||
|
|
Loading…
Reference in New Issue