From 534691a61afc83d0af27fa8168c40a537189f5e4 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 27 Sep 2020 17:59:11 -0400 Subject: [PATCH] some brave souls decided to return 202 for get requests --- activity.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/activity.go b/activity.go index b0f61c1..5624b02 100644 --- a/activity.go +++ b/activity.go @@ -176,8 +176,12 @@ func fetchsome(url string) ([]byte, error) { 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)