backend for xcvr appview

boop

+9 -1
+9 -1
server/internal/oauth/oauthclient.go
··· 1 1 package oauth 2 2 3 3 import ( 4 + "bytes" 4 5 "context" 5 6 "encoding/json" 6 7 "errors" 7 8 "fmt" 9 + "io" 8 10 9 11 "github.com/bluesky-social/indigo/api/atproto" 10 12 "github.com/bluesky-social/indigo/atproto/auth/oauth" ··· 178 180 func UploadBLOB(cs *oauth.ClientSession, file multipart.File, ctx context.Context) (*lexutil.BlobSchema, error) { 179 181 client := cs.APIClient() 180 182 181 - req := atpclient.NewAPIRequest("POST", "com.atproto.repo.uploadBlob", file) 183 + fileBytes, err := io.ReadAll(file) 184 + if err != nil { 185 + return nil, errors.New("failed to readall: " + err.Error()) 186 + } 187 + fileReader := bytes.NewReader(fileBytes) 188 + 189 + req := atpclient.NewAPIRequest("POST", "com.atproto.repo.uploadBlob", fileReader) 182 190 resp, err := client.Do(ctx, req) 183 191 if err != nil { 184 192 return nil, err