some brave souls decided to return 202 for get requests
This commit is contained in:
parent
60c27f27fc
commit
534691a61a
|
@ -176,8 +176,12 @@ func fetchsome(url string) ([]byte, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode != 200 {
|
switch resp.StatusCode {
|
||||||
return nil, fmt.Errorf("not 200: %d %s", resp.StatusCode, url)
|
case 200:
|
||||||
|
case 201:
|
||||||
|
case 202:
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("http get not 200: %d %s", resp.StatusCode, url)
|
||||||
}
|
}
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
limiter := io.LimitReader(resp.Body, 10*1024*1024)
|
limiter := io.LimitReader(resp.Body, 10*1024*1024)
|
||||||
|
|
Loading…
Reference in New Issue