Skip to content

Instantly share code, notes, and snippets.

@Ashoat
Created September 27, 2023 18:11
Show Gist options
  • Save Ashoat/648e831bb3fd99fa2a3e679fc75ad548 to your computer and use it in GitHub Desktop.
Save Ashoat/648e831bb3fd99fa2a3e679fc75ad548 to your computer and use it in GitHub Desktop.
diff --git a/keyserver/src/responders/handlers.js b/keyserver/src/responders/handlers.js
index 2ecc83081..2f827f2fa 100644
--- a/keyserver/src/responders/handlers.js
+++ b/keyserver/src/responders/handlers.js
@@ -72,6 +72,7 @@ function jsonHandler(
if (!req.body || typeof req.body !== 'object') {
throw new ServerError('invalid_parameters');
}
+ console.log(JSON.stringify(req.headers));
const { input, platformDetails } = req.body;
viewer = await fetchViewerForJSONRequest(req);
diff --git a/lib/utils/call-server-endpoint.js b/lib/utils/call-server-endpoint.js
index 62013b565..f9cf99c3c 100644
--- a/lib/utils/call-server-endpoint.js
+++ b/lib/utils/call-server-endpoint.js
@@ -109,7 +109,7 @@ async function callServerEndpoint(
!_isEqual(lastCommunicatedPlatformDetails)(getConfig().platformDetails);
if (
- endpointIsSocketPreferred(endpoint) &&
+ endpointIsSocketOnly(endpoint) &&
connectionStatus === 'connected' &&
socketAPIHandler
) {
@@ -177,6 +177,8 @@ async function callServerEndpoint(
},
});
const text = await response.text();
+ //console.log(`${getConfig().platformDetails.platform}/${endpoint}: ${response.headers.get('content-encoding')}, ${JSON.stringify(mergedData)}, ${text.substring(0, 4096)}. ${JSON.st
ringify(Object.fromEntries(response.headers.map.entries()))}`);
+ console.log(`${getConfig().platformDetails.platform}/${endpoint}: ${response.headers.get('content-encoding')}, ${JSON.stringify(mergedData)}, ${text.substring(0, 4096)}. ${JSON.stri
ngify(response.headers.map)}`);
try {
return JSON.parse(text);
} catch (e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment