From 1b984abd919dc4c4b3f8e20705c40deff35e4f09 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 23 May 2023 03:37:56 -0700 Subject: [PATCH] Fix error port display, again --- src/utils/proxy/handlers/generic.js | 4 ++-- src/utils/proxy/http.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/proxy/handlers/generic.js b/src/utils/proxy/handlers/generic.js index a2077b91d..91e0fa94f 100644 --- a/src/utils/proxy/handlers/generic.js +++ b/src/utils/proxy/handlers/generic.js @@ -58,11 +58,11 @@ export default async function genericProxyHandler(req, res, map) { if (status >= 400) { logger.debug( - "HTTP Error %d calling %s//%s:%s%s...", + "HTTP Error %d calling %s//%s%s%s...", status, url.protocol, url.hostname, - url.port, + url.port ? `:${url.port}` : '', url.pathname ); return res.status(status).json({error: {message: "HTTP Error", url: sanitizeErrorURL(url), resultData}}); diff --git a/src/utils/proxy/http.js b/src/utils/proxy/http.js index 1df0f5772..e022fb462 100644 --- a/src/utils/proxy/http.js +++ b/src/utils/proxy/http.js @@ -82,10 +82,10 @@ export async function httpProxy(url, params = {}) { } catch (err) { logger.error( - "Error calling %s//%s:%s%s...", + "Error calling %s//%s%s%s...", constructedUrl.protocol, constructedUrl.hostname, - constructedUrl.port, + constructedUrl.port ? `:${constructedUrl.port}` : '', constructedUrl.pathname ); logger.error(err);