From 683308ecf805e786b26ba751f484e5383a9399e6 Mon Sep 17 00:00:00 2001 From: Flavien Chantelot Date: Mon, 28 Jun 2021 11:24:28 +0200 Subject: [PATCH] fix: remove utf8 encoding on openstack publisher The utf8 encoding, which was not setted for other cloud storage providers, broke all images and other binary files. The files uploaded were unreadable except plain text files. So in a standard documentation, all images were broken Signed-off-by: Flavien Chantelot --- .changeset/gorgeous-timers-cover.md | 5 +++++ .../techdocs-common/src/stages/publish/openStackSwift.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/gorgeous-timers-cover.md diff --git a/.changeset/gorgeous-timers-cover.md b/.changeset/gorgeous-timers-cover.md new file mode 100644 index 0000000000..de71d740c0 --- /dev/null +++ b/.changeset/gorgeous-timers-cover.md @@ -0,0 +1,5 @@ +--- +'@backstage/techdocs-common': patch +--- + +Fix openStack swift publisher encoding issue. Remove utf8 forced encoding on binary files diff --git a/packages/techdocs-common/src/stages/publish/openStackSwift.ts b/packages/techdocs-common/src/stages/publish/openStackSwift.ts index 18944b5605..6be8539aa9 100644 --- a/packages/techdocs-common/src/stages/publish/openStackSwift.ts +++ b/packages/techdocs-common/src/stages/publish/openStackSwift.ts @@ -156,7 +156,7 @@ export class OpenStackSwiftPublish implements PublisherBase { const uploadFile = limiter( () => new Promise((res, rej) => { - const readStream = fs.createReadStream(filePath, 'utf8'); + const readStream = fs.createReadStream(filePath); const writeStream = this.storageClient.upload(params);