From 3994d9e9a07e694dc628f93be283a8dfa89c3312 Mon Sep 17 00:00:00 2001 From: Anwarul Islam Date: Tue, 19 Aug 2025 20:57:53 +0600 Subject: [PATCH] fix: preserve request name when importing cURL commands (#5337) Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> --- .../hoppscotch-common/src/components/http/ImportCurl.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-common/src/components/http/ImportCurl.vue b/packages/hoppscotch-common/src/components/http/ImportCurl.vue index ff2c1738..93057b31 100644 --- a/packages/hoppscotch-common/src/components/http/ImportCurl.vue +++ b/packages/hoppscotch-common/src/components/http/ImportCurl.vue @@ -149,7 +149,11 @@ const handleImport = () => { if (tabs.currentActiveTab.value.document.type === "example-response") return - tabs.currentActiveTab.value.document.request = req + // Preserve the existing request name when importing cURL + const currentRequest = tabs.currentActiveTab.value.document.request + const reqName = currentRequest?.name ?? req.name + + tabs.currentActiveTab.value.document.request = { ...req, name: reqName } } catch (e) { console.error(e) toast.error(`${t("error.curl_invalid_format")}`)