-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Server): support read body later
- Loading branch information
Showing
10 changed files
with
135 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
wrk.method = "POST" | ||
wrk.body = string.rep("-TEST_STRING-", 8192) | ||
wrk.headers["Content-Type"] = "text/plain" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const axios = require('axios') | ||
|
||
module.exports = async function ({ HTTP_PORT }) { | ||
const body = '__TEST__STRING__'.repeat(4096) | ||
|
||
const res = await axios.post(`http://localhost:${HTTP_PORT}/stream/body-later-1`, body) | ||
if (res.status !== 200) { | ||
throw new Error(`Response ${res.status}`) | ||
} | ||
if (res.headers['content-length'] !== body.length.toString()) { | ||
throw new Error('Content-Length mismatch') | ||
} | ||
if (res.data !== body) { | ||
throw new Error('Response data mismatch') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const axios = require('axios') | ||
|
||
module.exports = async function ({ HTTP_PORT }) { | ||
const body = '__TEST__STRING__'.repeat(4096) | ||
|
||
const res = await axios.post(`http://localhost:${HTTP_PORT}/stream/body-later-2`, body) | ||
if (res.status !== 200) { | ||
throw new Error(`Response ${res.status}`) | ||
} | ||
if (res.headers['content-length'] !== body.length.toString()) { | ||
throw new Error('Content-Length mismatch') | ||
} | ||
if (res.data !== body) { | ||
throw new Error('Response data mismatch') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters