From 45d461a3b81b3cefb750d02154deed8a185c7f44 Mon Sep 17 00:00:00 2001 From: John Knox Date: Mon, 3 Aug 2020 10:20:15 -0700 Subject: [PATCH] Don't escape and decode network response payloads Summary: This was originally done in https://github.com/facebook/flipper/pull/377 to support chinese characters, but it's not clear how it works, or what problem specifically it is trying to solve. It's causing some problems where valid responses are failing to be "decoded", so I'm removing it. Reviewed By: mweststrate Differential Revision: D22866879 fbshipit-source-id: a19a57b0ddba2b9f434eb3c37e6b92da1dfbef01 --- desktop/plugins/network/utils.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/desktop/plugins/network/utils.tsx b/desktop/plugins/network/utils.tsx index b3c24c5a1..0de72428e 100644 --- a/desktop/plugins/network/utils.tsx +++ b/desktop/plugins/network/utils.tsx @@ -31,9 +31,7 @@ export function decodeBody(container: Request | Response): string { return decompress(b64Decoded); } - // Data is transferred as base64 encoded bytes to support unicode characters, - // we need to decode the bytes here to display the correct unicode characters. - return decodeURIComponent(escape(b64Decoded)); + return b64Decoded; } catch (e) { console.warn('Discarding malformed body, size: ' + b64Decoded.length); return '';