From 6be52b2baa83cbd5f95d992b8a0208f7fc6dcc5b Mon Sep 17 00:00:00 2001 From: njg7194 Date: Sun, 1 Feb 2026 13:22:39 +0900 Subject: [PATCH] fix(request-snippets): escape pipe character in cURL CMD snippets The vertical bar character (|) is a special character in Windows CMD that is used for piping commands. When the request body contains a pipe character, the generated cURL command fails because CMD interprets it as a pipe operator. This fix escapes the pipe character with a caret (^|) in the escapeCMD function, consistent with how other special characters like ^ and newlines are handled. Fixes #10540 --- src/core/plugins/request-snippets/fn.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/plugins/request-snippets/fn.js b/src/core/plugins/request-snippets/fn.js index aea7c215657..f9f563d2389 100644 --- a/src/core/plugins/request-snippets/fn.js +++ b/src/core/plugins/request-snippets/fn.js @@ -33,6 +33,7 @@ const escapeCMD = (str) => { .replace(/\^/g, "^^") .replace(/\\"/g, "\\\\\"") .replace(/"/g, "\"\"") + .replace(/\|/g, "^|") .replace(/\n/g, "^\n") if (str === "-d ") { return str