From 3594a00202410795b824a246c5ac1661a6bbdb73 Mon Sep 17 00:00:00 2001 From: Dollerino Date: Thu, 7 Dec 2023 15:35:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A6=D0=98=D0=A2=D0=9A-43=20-=20=D0=9F=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D0=BA=D0=BE=D1=80=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/utils.js b/core/utils.js index a87978b..13d309a 100644 --- a/core/utils.js +++ b/core/utils.js @@ -238,8 +238,8 @@ const buildURL = prms => { let sCheckResult = validateObject(prms, prmsUtilsSchema.buildURL, "Параметры функции формирования URL"); //Если структура объекта в норме if (!sCheckResult) { - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! КОНТРОЛЬ КОРРЕКТНОСТИ - return `${prms.sSrvRoot}/${prms.sFnURL}${prms.sQuery ? `?${prms.sQuery}` : ""}`; + //Формируем URL с учетом лишних "/" + return `${prms.sSrvRoot.replace(/\/+$/, '')}/${prms.sFnURL.replace(/^\/+/, '')}${prms.sQuery ? `?${prms.sQuery}` : ""}`; } else { throw new ServerError(SERR_OBJECT_BAD_INTERFACE, sCheckResult); }