From ef653100ed1d388e22cfd7a206d19bfe1ec3e574 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Mon, 23 Mar 2020 06:42:08 -0700 Subject: [PATCH] Don't try to print large network bodies Summary: The network plugin warns about network requests that cannot be properly deflated if they are big and binary. Not sure yet why that is the case and if that is something that should be addressed (planned T63909985 for that), but if the body is big and binary it causes problems for our logging. While testing I had some requests that where 45m large, and Electron literally hang for a few minutes before recovering. Failed to capture that, but the test plan shows smaller cases of the problem Reviewed By: jknoxville Differential Revision: D20560083 fbshipit-source-id: 324eb180b203dd585814dba5c94373d8daee5dde --- desktop/plugins/network/utils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/network/utils.tsx b/desktop/plugins/network/utils.tsx index 2d106aee0..fd806cc17 100644 --- a/desktop/plugins/network/utils.tsx +++ b/desktop/plugins/network/utils.tsx @@ -35,7 +35,7 @@ export function decodeBody(container: Request | Response): string { // we need to decode the bytes here to display the correct unicode characters. return decodeURIComponent(escape(b64Decoded)); } catch (e) { - console.warn('Discarding malformed body:', escape(b64Decoded)); + console.warn('Discarding malformed body, size: ' + b64Decoded.length); return ''; } }