From 1c37a7cd0715949a70b220a629071c7dab7d5e7b Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 24 Jan 2023 06:39:48 +1100 Subject: [PATCH] fix: `ParseServer.verifyServerUrl` may fail if server response headers are missing; remove unnecessary logging (#8391) --- src/ParseServer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ParseServer.js b/src/ParseServer.js index eb443ce465..ed21ce12e3 100644 --- a/src/ParseServer.js +++ b/src/ParseServer.js @@ -240,7 +240,8 @@ class ParseServer { }); // verify the server url after a 'mount' event is received /* istanbul ignore next */ - api.on('mount', function () { + api.on('mount', async function () { + await new Promise(resolve => setTimeout(resolve, 1000)); ParseServer.verifyServerUrl(); }); } @@ -415,8 +416,7 @@ class ParseServer { const request = require('./request'); const response = await request({ url }).catch(response => response); const json = response.data || null; - console.log(response.status, { json }); - const retry = response.headers['retry-after']; + const retry = response.headers?.['retry-after']; if (retry) { await new Promise(resolve => setTimeout(resolve, retry * 1000)); return this.verifyServerUrl();