From f8ae9c1e1ad2ab5f262839233951ad2ad22423ca Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Wed, 17 May 2023 16:56:04 +0000 Subject: [PATCH] support for especial character --- .../marketplace_server/src/utils/resolveUrl/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/marketplace_server/src/utils/resolveUrl/index.js b/packages/marketplace_server/src/utils/resolveUrl/index.js index 0afb2a90..a9a33785 100644 --- a/packages/marketplace_server/src/utils/resolveUrl/index.js +++ b/packages/marketplace_server/src/utils/resolveUrl/index.js @@ -2,7 +2,16 @@ export default (from, to) => { const resolvedUrl = new URL(to, new URL(from, "resolve://")) if (resolvedUrl.protocol === "resolve:") { - const { pathname, search, hash } = resolvedUrl + let { pathname, search, hash } = resolvedUrl + + if (to.includes("@")) { + const fromUrl = new URL(from) + const toUrl = new URL(to, fromUrl.origin) + + pathname = toUrl.pathname + search = toUrl.search + hash = toUrl.hash + } return pathname + search + hash }