From b2c62ba105b7fb9fe2eb6a4ae1b95c8d5b67d428 Mon Sep 17 00:00:00 2001 From: Ajima Chukwuemeka <32770340+ajimae@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:05:58 +0100 Subject: [PATCH] [Fix][ST-29177] Issues with Special Characters ByteLength in SDK (#835) * fix(ts-client): issues with special characters encoding in sdk - install and use browser friendly buffer module to properly read body bytelength * fix(ts-client): issues with special characters encoding in sdk - install and use browser friendly buffer module to properly read body bytelength * chore(release-changeset): changeset - add release changeset * chore(ts-client): buffer type - add checks for Buffer body type * chore(ts-client): add test - add tests to validate functionality * chore(ts-client): add test - add more tests to validate functionality --- .changeset/purple-melons-share.md | 5 ++ examples/browser/browser.html | 6 +- packages/sdk-client-v3/package.json | 1 + .../sdk-client-v3/src/utils/byteLength.ts | 12 +++- .../tests/utils.test/byteLength.test.ts | 62 +++++++++++++++++++ 5 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 .changeset/purple-melons-share.md create mode 100644 packages/sdk-client-v3/tests/utils.test/byteLength.test.ts diff --git a/.changeset/purple-melons-share.md b/.changeset/purple-melons-share.md new file mode 100644 index 000000000..e9c4caf43 --- /dev/null +++ b/.changeset/purple-melons-share.md @@ -0,0 +1,5 @@ +--- +'@commercetools/ts-client': patch +--- + +Fix issues with counting special characters' length diff --git a/examples/browser/browser.html b/examples/browser/browser.html index 31ba3b218..c7bc95f4e 100644 --- a/examples/browser/browser.html +++ b/examples/browser/browser.html @@ -6,7 +6,7 @@