We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6.3.0
6.4.0
22.13.1
macOS
MacOS 15.3
I tried to upgrade light-my-request from 6.3.0 to 6.5.1 and my tests containing uploads now fail (they also fail with version >= 6.4.0)
With the provided sample, it get the following error:
Cannot read properties of undefined (reading 'buffer')
It seems multer fail to read the multipart data with the last version of light-my-request.
express: 4.21.2 multer: 1.4.5-lts.1
Here is a simple test i have (using vitest):
it("should return the file content", async () => { const multerMiddleware = multer({ storage: multer.memoryStorage(), limits: { fileSize: 1024, }, }) const app = express() app.post("/hello", multerMiddleware.single("textFile"), (req, res) => { res.send(req.file.buffer.toString("utf8")) }) app.use((err, req, res, next) => { console.warn(err) res.status(500).send("Something was wrong") }) const formData = new FormData() formData.append("textFile", new Blob(["some data"]), "sample.txt") const response = await LightMyRequest.inject(app, { method: "POST", url: "http://example.com:8080/hello", payload: formData, }) expect(response.statusCode).toEqual(200) expect(response.payload).toEqual("some data") })
No response
The text was updated successfully, but these errors were encountered:
Add transfer-encoding for streaming
3b072b8
Fixes: #337 Signed-off-by: Matteo Collina <[email protected]>
Successfully merging a pull request may close this issue.
Prerequisites
Last working version
6.3.0
Stopped working in version
6.4.0
Node.js version
22.13.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
MacOS 15.3
💥 Regression Report
I tried to upgrade light-my-request from 6.3.0 to 6.5.1 and my tests containing uploads now fail (they also fail with version >= 6.4.0)
With the provided sample, it get the following error:
It seems multer fail to read the multipart data with the last version of light-my-request.
express: 4.21.2
multer: 1.4.5-lts.1
Steps to Reproduce
Here is a simple test i have (using vitest):
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: