Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updating with corresponding tests.

  • Loading branch information...
commit dba2ebf09552258f37b60122c19b236064b0d216 1 parent 3daebaf
Derek Bredensteiner authored
3  main.js
@@ -663,11 +663,12 @@ Request.prototype.multipart = function (multipart) {
663 663
664 664 if (!multipart.forEach) throw new Error('Argument error, options.multipart.')
665 665
  666 + self.body.push(new Buffer('\r\n'))
666 667 multipart.forEach(function (part) {
667 668 var body = part.body
668 669 if(body == null) throw Error('Body attribute missing in multipart.')
669 670 delete part.body
670   - var preamble = '\r\n' + '--' + self.boundary + '\r\n'
  671 + var preamble = '--' + self.boundary + '\r\n'
671 672 Object.keys(part).forEach(function (key) {
672 673 preamble += key + ': ' + part[key] + '\r\n'
673 674 })
2  tests/test-body.js
@@ -52,7 +52,7 @@ var tests =
52 52 }
53 53 , testPutMultipart :
54 54 { resp: server.createPostValidator(
55   - '--__BOUNDARY__\r\n' +
  55 + '\r\n--__BOUNDARY__\r\n' +
56 56 'content-type: text/html\r\n' +
57 57 '\r\n' +
58 58 '<html><body>Oh hi.</body></html>' +
2  tests/test-https-strict.js
@@ -52,7 +52,7 @@ var tests =
52 52 }
53 53 , testPutMultipart :
54 54 { resp: server.createPostValidator(
55   - '--__BOUNDARY__\r\n' +
  55 + '\r\n--__BOUNDARY__\r\n' +
56 56 'content-type: text/html\r\n' +
57 57 '\r\n' +
58 58 '<html><body>Oh hi.</body></html>' +
2  tests/test-https.js
@@ -44,7 +44,7 @@ var tests =
44 44 }
45 45 , testPutMultipart :
46 46 { resp: server.createPostValidator(
47   - '--__BOUNDARY__\r\n' +
  47 + '\r\n--__BOUNDARY__\r\n' +
48 48 'content-type: text/html\r\n' +
49 49 '\r\n' +
50 50 '<html><body>Oh hi.</body></html>' +

0 comments on commit dba2ebf

Please sign in to comment.
Something went wrong with that request. Please try again.