From ee6d173033b5d2fd31e865319bec0c4c89398664 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Mon, 24 Jan 2022 22:51:41 +0530 Subject: [PATCH] fix: respect environment variable in url before adding protocol - resolved #2084 --- packages/hoppscotch-app/components/http/Request.vue | 5 ++++- packages/hoppscotch-app/vue2-shim.d.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-app/components/http/Request.vue b/packages/hoppscotch-app/components/http/Request.vue index 353eda679..4759408f0 100644 --- a/packages/hoppscotch-app/components/http/Request.vue +++ b/packages/hoppscotch-app/components/http/Request.vue @@ -348,7 +348,10 @@ const newSendRequest = async () => { } const ensureMethodInEndpoint = () => { - if (!/^http[s]?:\/\//.test(newEndpoint.value)) { + if ( + !/^http[s]?:\/\//.test(newEndpoint.value) && + !newEndpoint.value.startsWith("<<") + ) { const domain = newEndpoint.value.split(/[/:#?]+/)[0] if (domain === "localhost" || /([0-9]+\.)*[0-9]/.test(domain)) { setRESTEndpoint("http://" + newEndpoint.value) diff --git a/packages/hoppscotch-app/vue2-shim.d.ts b/packages/hoppscotch-app/vue2-shim.d.ts index 43b634e13..6ccc01e58 100644 --- a/packages/hoppscotch-app/vue2-shim.d.ts +++ b/packages/hoppscotch-app/vue2-shim.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/export */ // workaround for Volar to infer the ref type in