Skip to content

Commit

Permalink
fix(share credits): use web polyfilled safe Buffer.from over Readable…
Browse files Browse the repository at this point in the history
….from
  • Loading branch information
fedellen committed Nov 6, 2024
1 parent b0dbfab commit 473a469
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class TurboHTTPService implements TurboHTTPServiceInterface {
throw new FailedRequestError(
status,
// Return error message from server if available
typeof data === 'string' ? data : statusText,
typeof response === 'string' ? response : statusText,
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export abstract class TurboAuthenticatedBaseUploadService
approvedAddress + approvedWincAmount + Date.now(),
);
const { createdApproval, ...uploadResponse } = await this.uploadFile({
fileStreamFactory: () => Readable.from(nonceData),
fileStreamFactory: () => Buffer.from(nonceData),
fileSizeFactory: () => nonceData.byteLength,
dataItemOpts,
});
Expand All @@ -373,7 +373,7 @@ export abstract class TurboAuthenticatedBaseUploadService

const nonceData = Buffer.from(revokedAddress + Date.now());
const { revokedApprovals, ...uploadResponse } = await this.uploadFile({
fileStreamFactory: () => Readable.from(nonceData),
fileStreamFactory: () => Buffer.from(nonceData),
fileSizeFactory: () => nonceData.byteLength,
dataItemOpts,
});
Expand Down

0 comments on commit 473a469

Please sign in to comment.