Skip to content

Commit f8ea167

Browse files
committed
fixed e2e tests
1 parent f18b4ea commit f8ea167

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

cypress/e2e/spec.cy.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("HTTP response status", () => {
4141
});
4242
});
4343
it("should get status 413 Entity Too Large", () => {
44-
const bigPayload = "A".repeat(3 * 1024 * 1024); // 3 MB payload
44+
const bigPayload = "A".repeat(102401); // 2 KB + 1 byte payload
4545

4646
cy.request({
4747
url: "/cgi-bin/env.js",
@@ -60,20 +60,20 @@ describe("HTTP response status", () => {
6060
expect(response.status).to.equal(500);
6161
});
6262
});
63-
it("should get status 200 outside of url path", () => {
63+
it("should get status 504 Gateway Timeout", () => {
6464
cy.request({
65-
url: "/outside-urlpath",
65+
url: "/cgi-bin/timeout.js",
6666
failOnStatusCode: false,
6767
}).then((response) => {
68-
expect(response.status).to.equal(200);
68+
expect(response.status).to.equal(504);
6969
});
7070
});
71-
it("should get status 504 Gateway Timeout", () => {
71+
it("should get status 200 outside of url path", () => {
7272
cy.request({
73-
url: "/cgi-bin/timeout.js",
73+
url: "/outside-urlpath",
7474
failOnStatusCode: false,
7575
}).then((response) => {
76-
expect(response.status).to.equal(504);
76+
expect(response.status).to.equal(200);
7777
});
7878
});
7979
});

server/http.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ const callback = createHandler({
3838
indexExtension: "cgi",
3939
debugOutput: true,
4040
logRequests: true,
41-
maxBuffer: 1024 ** 2, // 1MB
41+
maxBuffer: 102400, // 100KB
4242
requestChunkSize: 4 * 1024,
4343
responseChunkSize: 4 * 1024,
44-
requestTimeout: 3000, // 3s
44+
requestTimeout: 1000, // 1s
4545
env: (env, req) => {
4646
return {
4747
REMOTE_AGENT: req.headers["user-agent"],

server/https.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ const callback = createHandler({
3939
indexExtension: "cgi",
4040
debugOutput: true,
4141
logRequests: true,
42-
maxBuffer: 1024 ** 2, // 1MB
42+
maxBuffer: 102400, // 100KB
4343
requestChunkSize: 4 * 1024,
4444
responseChunkSize: 4 * 1024,
45-
requestTimeout: 3000, // 3s
45+
requestTimeout: 1000, // 1s
4646
env: (env, req) => {
4747
return {
4848
REMOTE_AGENT: req.headers["user-agent"],

0 commit comments

Comments
 (0)