diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-17 12:25:32 -0400 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-17 12:25:32 -0400 |
| commit | cca92e4ba601b4a738807224b4abe53228bab1a0 (patch) | |
| tree | ad34fcdacbe981b6c7b35ba9fb1717242edfeef5 /src | |
| parent | e33d446ee8457f8ae114e33210382668efba92a9 (diff) | |
| download | ao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.tar.gz ao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.tar.bz2 ao-coverage-cca92e4ba601b4a738807224b4abe53228bab1a0.zip | |
#14 Changed /bash file to /sh
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes.test.ts | 14 | ||||
| -rw-r--r-- | src/routes.ts | 4 |
2 files changed, 10 insertions, 8 deletions
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` + ); }); }); }); diff --git a/src/routes.ts b/src/routes.ts index d242902..3ab55ae 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -60,8 +60,8 @@ export default (metadata: Metadata): Router => { // serve script for posting coverage report router.use( - "/bash", - express.static(path.join(metadata.getHostDir(), "bash"), { + "/sh", + express.static(path.join(metadata.getHostDir(), "sh"), { setHeaders: res => res.contentType("text/plain") }) ); |
