Permalink
Browse files

Updating with corresponding tests.

  • Loading branch information...
1 parent 3daebaf commit dba2ebf09552258f37b60122c19b236064b0d216 Derek Bredensteiner committed Jul 6, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −1 main.js
  2. +1 −1 tests/test-body.js
  3. +1 −1 tests/test-https-strict.js
  4. +1 −1 tests/test-https.js
View
@@ -663,11 +663,12 @@ Request.prototype.multipart = function (multipart) {
if (!multipart.forEach) throw new Error('Argument error, options.multipart.')
+ self.body.push(new Buffer('\r\n'))
multipart.forEach(function (part) {
var body = part.body
if(body == null) throw Error('Body attribute missing in multipart.')
delete part.body
- var preamble = '\r\n' + '--' + self.boundary + '\r\n'
+ var preamble = '--' + self.boundary + '\r\n'
Object.keys(part).forEach(function (key) {
preamble += key + ': ' + part[key] + '\r\n'
})
View
@@ -52,7 +52,7 @@ var tests =
}
, testPutMultipart :
{ resp: server.createPostValidator(
- '--__BOUNDARY__\r\n' +
+ '\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
@@ -52,7 +52,7 @@ var tests =
}
, testPutMultipart :
{ resp: server.createPostValidator(
- '--__BOUNDARY__\r\n' +
+ '\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +
View
@@ -44,7 +44,7 @@ var tests =
}
, testPutMultipart :
{ resp: server.createPostValidator(
- '--__BOUNDARY__\r\n' +
+ '\r\n--__BOUNDARY__\r\n' +
'content-type: text/html\r\n' +
'\r\n' +
'<html><body>Oh hi.</body></html>' +

0 comments on commit dba2ebf

Please sign in to comment.