MCPcopy
hub / github.com/probelabs/goreplay / TEST_httpPath

Function TEST_httpPath

middleware/middleware.js:565–584  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563}
564
565function TEST_httpPath() {
566 const examplePayload = "GET /test HTTP/1.1\r\n\r\n";
567
568 let payload = Buffer.from(examplePayload);
569 let path = httpPath(payload);
570
571 if (path != "/test") {
572 return fail(`Path '${patj}' != '/test'`)
573 }
574
575 let newPayload = setHttpPath(payload, '/')
576 if (newPayload.toString() != "GET / HTTP/1.1\r\n\r\n") {
577 return fail(`Malformed payload '${newPayload}'`)
578 }
579
580 newPayload = setHttpPath(payload, '/bigger')
581 if (newPayload.toString() != "GET /bigger HTTP/1.1\r\n\r\n") {
582 return fail(`Malformed payload '${newPayload}'`)
583 }
584}
585
586function TEST_httpMethod() {
587 const examplePayload = "GET /test HTTP/1.1\r\n\r\n";

Callers

nothing calls this directly

Calls 3

httpPathFunction · 0.85
failFunction · 0.85
setHttpPathFunction · 0.85

Tested by

no test coverage detected