From 56e553a0d84544628c5f824ef6473fb52f934e8f Mon Sep 17 00:00:00 2001 From: "Paul B." Date: Wed, 11 Dec 2024 17:10:59 +0100 Subject: [PATCH] Use single quotes around URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds single quotes around the URL of the curl command. It makes sure to make curl commands with a URL that contains multiple query param work well in *nix terminals. e.g. `curl http://example.com?query=one&query=two` the terminal will interpret the `&` character as a “send to background” command. [See this SO thread for details](https://stackoverflow.com/questions/13339469/how-to-include-an-character-in-a-bash-curl-statement) --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index e321f0b..bd9a7d3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -148,7 +148,7 @@ const CurlGenerator = function ( options?: CurlAdditionalOptions ): string { let curlSnippet = "curl "; - curlSnippet += params.url; + curlSnippet += "'" + params.url + "'"; curlSnippet += getCurlMethod(params.method); curlSnippet += getCurlHeaders(params.headers); curlSnippet += getCurlBody(params.body);