From cca92e4ba601b4a738807224b4abe53228bab1a0 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Fri, 17 Sep 2021 12:25:32 -0400 Subject: #14 Changed /bash file to /sh --- src/routes.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/routes.test.ts') diff --git a/src/routes.test.ts b/src/routes.test.ts index 5ffd289..d761602 100644 --- a/src/routes.test.ts +++ b/src/routes.test.ts @@ -88,21 +88,21 @@ const HOST_DIR = configOrError("HOST_DIR"); const TARGET_URL = process.env.TARGET_URL ?? "http://localhost:3000"; describe("templates", () => { - describe("GET /bash", () => { - it("should return the bash file containing the curl command", async () => { + describe("GET /sh", () => { + it("should return the sh file containing the curl command", async () => { await persistTemplate({ inputFile: path.join( __dirname, "..", "public", "templates", - "bash.template" + "sh.template" ), - outputFile: path.join(HOST_DIR, "bash"), + outputFile: path.join(HOST_DIR, "sh"), context: { TARGET_URL } } as Template); - const res = await (await request()).get("/bash").expect(200); + const res = await (await request()).get("/sh").expect(200); expect(exit).not.toHaveBeenCalled(); expect(res.text).toMatch("curl -X POST"); expect(res.text).toMatch(`url="${TARGET_URL}"`); @@ -128,7 +128,9 @@ describe("templates", () => { .expect("Content-Type", /html/) .expect(200); expect(exit).not.toHaveBeenCalled(); - expect(res.text).toMatch(`bash <(curl -s ${TARGET_URL}/bash)`); + expect(res.text).toMatch( + `curl --proto '=https' --tlsv1.2 -sSf ${TARGET_URL}/sh | sh` + ); }); }); }); -- cgit