pass reader around instead of []byte

This commit is contained in:
tsmethurst 2022-01-16 18:52:55 +01:00
commit 589bb9df02
14 changed files with 246 additions and 394 deletions

View file

@ -23,6 +23,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"net/url"
"strings"
@ -251,7 +252,7 @@ func (d *deref) fetchHeaderAndAviForAccount(ctx context.Context, targetAccount *
return err
}
data := func(innerCtx context.Context) ([]byte, error) {
data := func(innerCtx context.Context) (io.Reader, error) {
return t.DereferenceMedia(innerCtx, avatarIRI)
}
@ -273,7 +274,7 @@ func (d *deref) fetchHeaderAndAviForAccount(ctx context.Context, targetAccount *
return err
}
data := func(innerCtx context.Context) ([]byte, error) {
data := func(innerCtx context.Context) (io.Reader, error) {
return t.DereferenceMedia(innerCtx, headerIRI)
}