request hangs for some uploads
See original GitHub issueUse this payload: http://superjoe.s3.amazonaws.com/temp/busboy-payload.pdf
node version 0.10.24 busboy 0.0.13
var http = require('http');
var Busboy = require('busboy');
var server = http.createServer(function(req, res) {
if (req.url === '/') {
res.statusCode = 200;
res.end('<!doctype html>'+
'<html>'+
'<head>'+
'</head>'+
'<body>'+
'<form action="/upload" method="post" enctype="multipart/form-data">'+
' <input type="file" name="avatar">'+
' <input type="submit">'+
'</form>'+
'</body>'+
'</html>');
} else if (req.url === '/upload') {
var bboy = new Busboy({
headers : req.headers,
limits : {fileSize:2*1024*1024, files:1}
});
bboy.on('file', function(fieldname, file, filename, encoding, mimetype){
console.log("aborting the request");
res.statusCode = 400;
res.end("hello browser");
});
req.pipe(bboy);
} else {
console.info("unexpected path", req.url);
}
});
server.listen(9191, function() {
console.info("listening at http://0.0.0.0:9191/");
});
When I upload that payload, the request completely hangs. The browser never sees “hello browser”.
Issue Analytics
- State:
- Created 10 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Post request hangs in certain cases when body is a StringIO
This is how StringIO instances work and misusing them is not a bug in requests because partial file uploads are very desirable. Especially...
Read more >For no obvious reasons, my request hangs when I try to ...
When request hangs control gained back is not printed(when I try to upload files bigger than 20 mb) But I see below error...
Read more >Python requests .post hangs on large HTTPS payload
I am uploading some data to a graph DB using a POST call, as follows: with open(turtle, 'rb') as data: if graph: params...
Read more >IIS7 hangs on requests while uploading file - Server Fault
The problem is that, when I start an upload and meanwhile try to continue using the application in another tab, the request just...
Read more >Error Request timed out when you try to upload a large file to a ...
Describes an issue that occurs when you try to upload a large file to a document library on a Windows SharePoint Services 3.0...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
file.resume()
is the magic sauce here. I now see that it is mentioned in the docs to do this, but it is a little bit buried. I added a suggested example to the readme in the hopes that it might prevent other people from running into this.Right, as I mentioned,
file.resume();
is fine in that case.