Skip to content

Commit

Permalink
Fix upload of playground package bundle (microsoft#3790)
Browse files Browse the repository at this point in the history
A recent break in storage blob SDK corrupted the uploading of certain
files Azure/azure-sdk-for-js#30138 when using
the `upload(text, length)` method. Switching to converting to a buffer
and uploading fixes the issue.
  • Loading branch information
timotheeguerin committed Jul 9, 2024
1 parent 9c02155 commit b2c03c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/bundle-uploader/src/upload-browser-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ export class TypeSpecBundledPackageUploader {
const blob = this.#container.getBlockBlobClient(
normalizePath(join(pkgName, version, file.filename))
);
const content = file.content;
await blob.upload(content, content.length, {
await blob.uploadData(Buffer.from(file.content), {
blobHTTPHeaders: {
blobContentType: "application/javascript; charset=utf-8",
},
Expand Down

0 comments on commit b2c03c5

Please sign in to comment.