cojs / busboy

Busboy multipart parser as a yieldable
154 stars 24 forks source link

enter the busboy module twice,but the opations.headers is different? #16

Closed Mrluobo closed 9 years ago

Mrluobo commented 9 years ago

I am studying the koa example--multipart,there is my code:

    var parts = parse(this.request,{
        autoFields:true
    });
    var tmpdir = path.join(os.tmpdir(),uid());

    yield fs.mkdir(tmpdir);
    var files = [];
    var file;
    var part;
    while(part = yield parts){
        files.push(file = path.join(tmpdir,part.filename));
        yield saveTo(part,file);
    }

there is a error "Missing content type" when i test use:

<form method="post" action="http://localhost:3000" enctype="multipart/form-data">
        <input type="file" name="test">
        <input type="submit" value="test">
    </form>

so I log the opations.headers,before new Busboy(options) i found the headers log twice and they are different.

why they log twice and why they are differents?

thanks i am a fresher

Mrluobo commented 9 years ago

sorry i understand as i comment the issues ,because i didn't checkout the content type so there is a get favicon.ico

haoxins commented 9 years ago

there is a get favicon.ico

yes