Skip to content

Commit

Permalink
multipart/form-data
Browse files Browse the repository at this point in the history
lol!!! wtf
  • Loading branch information
tj committed Jan 14, 2012
1 parent 2df61c8 commit 4105018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/node/part.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ Part.prototype.__proto__ = Stream.prototype;
*/

Part.prototype.assignBoundary = function(){
var boundary = utils.uid(32)
, type = this.req.get('Content-Type') || 'multipart/mixed';
this.req.set('Content-Type', type + '; boundary="' + boundary + '"');
var boundary = utils.uid(32);
this.req.set('Content-Type', 'multipart/form-data; boundary="' + boundary + '"');
this.req._boundary = boundary;
};

Expand Down
4 changes: 2 additions & 2 deletions test/node/multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Part', function(){

req.end(function(res){
var ct = res.header['content-type'];
ct.should.include.string('multipart/mixed; boundary="');
ct.should.include.string('multipart/form-data; boundary="');

var body = '\r\n';
body += '--' + boundary(ct) + '\r\n';
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Part', function(){

req.end(function(res){
var ct = res.header['content-type'];
ct.should.include.string('multipart/mixed; boundary="');
ct.should.include.string('multipart/form-data; boundary="');

var body = '';
body += '\r\n--' + boundary(ct) + '\r\n';
Expand Down

0 comments on commit 4105018

Please sign in to comment.