Skip to content

Commit 5e64262

Browse files
committed
chore: add changelog
1 parent 5088415 commit 5e64262

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.changeset/unlucky-feet-give.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@redocly/respect-core": patch
3+
"@redocly/openapi-core": patch
4+
"@redocly/cli": patch
5+
---
6+
7+
Fixed binary response data in `Respect` results by properly encoding as base64.
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
import { isBrowser } from '@redocly/openapi-core';
22

3-
/**
4-
* Converts an ArrayBuffer to base64 string in a cross-platform way
5-
* Works in Node.js, browser, and Tauri environments
6-
*/
73
export function arrayBufferToBase64(buffer: ArrayBuffer): string {
84
if (isBrowser) {
9-
// Browser environment - use built-in btoa with Uint8Array
105
const bytes = new Uint8Array(buffer);
116
let binary = '';
127
for (let i = 0; i < bytes.byteLength; i++) {
138
binary += String.fromCharCode(bytes[i]);
149
}
1510
return btoa(binary);
1611
} else {
17-
// Node.js environment - use Buffer
1812
return Buffer.from(buffer).toString('base64');
1913
}
2014
}

0 commit comments

Comments
 (0)