Open ZenoHu opened 2 months ago
mac
https://codesandbox.io/p/devbox/pensive-poitras-3xsl4r?embed=1&file=%2Fserver%2Fapi%2Fv1%2Fupload.post.ts
routeRules: { "/proxy/**": { proxy: { to: "/api/v1/**", }, }, },
import { IncomingForm } from "formidable";
export default defineEventHandler(async (event) => { event.node.req.on("data", (chunk) => { // will not log when submit to /proxy/upload console.log("data received", chunk); });
const form = new IncomingForm({ uploadDir: "./upload" });
form.parse(event.node.req, (_, __, files) => { // will not log when submit to /proxy/upload console.log(files); });
return "success"; });
### Additional context _No response_ ### Logs _No response_
Environment
mac
Reproduction
https://codesandbox.io/p/devbox/pensive-poitras-3xsl4r?embed=1&file=%2Fserver%2Fapi%2Fv1%2Fupload.post.ts
Describe the bug
export default defineEventHandler(async (event) => { event.node.req.on("data", (chunk) => { // will not log when submit to /proxy/upload console.log("data received", chunk); });
const form = new IncomingForm({ uploadDir: "./upload" });
form.parse(event.node.req, (_, __, files) => { // will not log when submit to /proxy/upload console.log(files); });
return "success"; });