fix(curlify): replace all occurrences of $ (#6354)

* replace all occurrences instead of only first occurrence
This commit is contained in:
Alec Theriault
2020-09-10 13:11:11 -04:00
committed by GitHub
parent 255aa205cd
commit 89d57fc078
2 changed files with 15 additions and 2 deletions

View File

@@ -351,4 +351,17 @@ describe("curlify", function () {
expect(curlified).toEqual("curl -X POST \"http://example.com\" -H \"X-DOLLAR: token/123\\$\" -d \"CREATE (\\$props)\"")
})
it("should escape multiple dollar signs", function () {
let req = {
url: "http://example.com",
method: "POST",
headers: { },
body: "RETURN $x + $y"
}
let curlified = curl(Im.fromJS(req))
expect(curlified).toEqual("curl -X POST \"http://example.com\" -d \"RETURN \\$x + \\$y\"")
})
})