Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

fix decoding

Changed files
+4 -4
hosting-service
src
lib
+4 -4
hosting-service/src/lib/utils.ts
··· 268 268 // Allow up to 100MB per file blob, with 2 minute timeout 269 269 let content = await safeFetchBlob(blobUrl, { maxSize: 100 * 1024 * 1024, timeout: 120000 }); 270 270 271 - // If content is base64-encoded, decode it back to gzipped binary 272 - if (base64 && encoding === 'gzip') { 273 - // Convert Uint8Array to Buffer for proper string conversion 271 + // If content is base64-encoded, decode it back to binary (gzipped or not) 272 + if (base64) { 273 + // The content from the blob is base64 text, decode it directly to binary 274 274 const buffer = Buffer.from(content); 275 - const base64String = buffer.toString('utf-8'); 275 + const base64String = buffer.toString('ascii'); // Use ascii for base64 text, not utf-8 276 276 content = Buffer.from(base64String, 'base64'); 277 277 } 278 278