Skip to content

Commit

Permalink
properly escape single backtick in curl commands
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava committed Jul 19, 2024
1 parent 358840f commit 53fd087
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function unsafeStringifyHttpRequestExampleToCurl({

const stringValue = JSON.stringify(value, null, 2);

return ` \\\n -F ${key}='${stringValue.replace(/'/g, "\\'")}${contentType != null ? `;type=${contentType}` : ""}'`;
return ` \\\n -F ${key}='${stringValue.replace(/'/g, "'\\''")}${contentType != null ? `;type=${contentType}` : ""}'`;
},
file: ({ fileName, contentType }) => {
if (fileName == null) {
Expand Down

0 comments on commit 53fd087

Please sign in to comment.