all repos — honk @ 1562c3383e3d331d16661e3cbedba5637fbae43d

my fork of honk

const fetch size
Ted Unangst tedu@tedunangst.com
Tue, 27 Feb 2024 15:22:01 -0500
commit

1562c3383e3d331d16661e3cbedba5637fbae43d

parent

d61c72d0643cb9eb62a047b367bda78d8854ac30

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M activity.goactivity.go

@@ -269,10 +269,12 @@ default:

return nil, fmt.Errorf("http get not 200: %d %s", resp.StatusCode, url) } var buf bytes.Buffer - limiter := io.LimitReader(resp.Body, 14*1024*1024) + limiter := io.LimitReader(resp.Body, maxFetchSize) io.Copy(&buf, limiter) return buf.Bytes(), nil } + +const maxFetchSize = 14 * 1024 * 1024 func savedonk(url string, name, desc, media string, localize bool) *Donk { if url == "" {

@@ -295,7 +297,7 @@ goto saveit

} data = ii.([]byte) - if len(data) == 10*1024*1024 { + if len(data) == maxFetchSize { ilog.Printf("truncation likely") } if strings.HasPrefix(media, "image") {