From bbbb6d762b03c7d42327a71380b531017cbf5ee0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 12 Aug 2023 00:44:00 +0300 Subject: Fix SSR props decoding Binary solution includes some trailing zero bytes and I have no time to debug --- vnext/server/middleware/renderer.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'vnext/server') diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js index e7e0324e..ae2600a7 100644 --- a/vnext/server/middleware/renderer.js +++ b/vnext/server/middleware/renderer.js @@ -12,16 +12,6 @@ import { VisitorProvider } from '../../src/ui/VisitorContext' import path from 'path' import fs from 'fs' -// convert a Unicode string to a string in which -// each 16-bit unit occupies only one byte -function toBinary(string) { - const codeUnits = new Uint16Array(string.length) - for (let i = 0; i < codeUnits.length; i++) { - codeUnits[i] = string.charCodeAt(i) - } - return Buffer.from(String.fromCharCode(...new Uint8Array(codeUnits.buffer))).toString('base64') -} - const STATIC_ROOT = config.get('service.static_root') || path.resolve(__dirname, 'public') const serverRenderer = async (req, res) => { @@ -47,7 +37,7 @@ const serverRenderer = async (req, res) => { const marker = '