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")}`)