some brave souls decided to return 202 for get requests
Ted Unangst tedu@tedunangst.com
Sun, 27 Sep 2020 17:59:11 -0400
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -176,8 +176,12 @@ log.Printf("error fetching %s: %s", url, err)
return nil, err } defer resp.Body.Close() - if resp.StatusCode != 200 { - return nil, fmt.Errorf("not 200: %d %s", resp.StatusCode, url) + switch resp.StatusCode { + case 200: + case 201: + case 202: + default: + return nil, fmt.Errorf("http get not 200: %d %s", resp.StatusCode, url) } var buf bytes.Buffer limiter := io.LimitReader(resp.Body, 10*1024*1024)