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

@ -21,6 +21,7 @@ package dereferencing
import (
"context"
"fmt"
"io"
"net/url"
"github.com/superseriousbusiness/gotosocial/internal/media"
@ -41,7 +42,7 @@ func (d *deref) GetRemoteMedia(ctx context.Context, requestingUsername string, a
return nil, fmt.Errorf("GetRemoteMedia: error parsing url: %s", err)
}
dataFunc := func(innerCtx context.Context) ([]byte, error) {
dataFunc := func(innerCtx context.Context) (io.Reader, error) {
return t.DereferenceMedia(innerCtx, derefURI)
}