diff --git a/.changeset/grumpy-trains-juggle.md b/.changeset/grumpy-trains-juggle.md new file mode 100644 index 0000000000..91ba37b72a --- /dev/null +++ b/.changeset/grumpy-trains-juggle.md @@ -0,0 +1,5 @@ +--- +'@backstage/techdocs-common': patch +--- + +Fix bug where binary files (`png`, etc.) could not load when using AWS or GCS publisher. diff --git a/packages/techdocs-common/src/stages/publish/awsS3.ts b/packages/techdocs-common/src/stages/publish/awsS3.ts index 15ff33408a..a17bd25011 100644 --- a/packages/techdocs-common/src/stages/publish/awsS3.ts +++ b/packages/techdocs-common/src/stages/publish/awsS3.ts @@ -186,7 +186,7 @@ export class AwsS3Publish implements PublisherBase { fileStreamChunks.push(chunk); }) .on('end', () => { - const fileContent = Buffer.concat(fileStreamChunks).toString(); + const fileContent = Buffer.concat(fileStreamChunks); // Inject response headers for (const [headerKey, headerValue] of Object.entries( responseHeaders, diff --git a/packages/techdocs-common/src/stages/publish/googleStorage.ts b/packages/techdocs-common/src/stages/publish/googleStorage.ts index b33e2bfbe0..12a92aeb53 100644 --- a/packages/techdocs-common/src/stages/publish/googleStorage.ts +++ b/packages/techdocs-common/src/stages/publish/googleStorage.ts @@ -184,7 +184,7 @@ export class GoogleGCSPublish implements PublisherBase { fileStreamChunks.push(chunk); }) .on('end', () => { - const fileContent = Buffer.concat(fileStreamChunks).toString(); + const fileContent = Buffer.concat(fileStreamChunks); // Inject response headers for (const [headerKey, headerValue] of Object.entries( responseHeaders,