-
-
Save Dador/746e9b7806f2d3b0f4e7d6913950fc00 to your computer and use it in GitHub Desktop.
Reproduce for https://github.com/microsoft/vscode/issues/190859
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
head -c 10000 /dev/urandom | curl 'http://127.0.0.1:9090/' -X POST --data-binary @- |
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
node test-server.js |
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
const http = require("http"); | |
const port = 9090; | |
const httpServer = http.createServer((req, res) => { | |
console.log("on req"); | |
req.on("error", (err) => { | |
console.error("Error in req.on error", err); | |
res.writeHead(400); | |
res.end("Read error"); | |
}); | |
req.on("data", (chunk) => { | |
try { | |
console.log("on data", chunk.length); | |
} catch (e) { | |
console.error("Error in req.on data", e); | |
} | |
}); | |
req.on("end", () => { | |
console.log("on end"); | |
res.writeHead(200); | |
res.end("Ok"); | |
}); | |
}); | |
httpServer.listen(port, () => { | |
console.log(`Server is running on port ${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment