Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix for bug report [ 2151981 ] SimpleMultipartEncoding#writeHeadersTo…
Browse files Browse the repository at this point in the history
…() has wrong delimiter
  • Loading branch information
perrick committed Feb 7, 2009
1 parent 0c70ffe commit 21ca70f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion encoding.php
Expand Up @@ -521,7 +521,7 @@ function __construct($query = false, $boundary = false) {
*/
function writeHeadersTo(&$socket) {
$socket->write("Content-Length: " . (integer)strlen($this->encode()) . "\r\n");
$socket->write("Content-Type: multipart/form-data, boundary=" . $this->boundary . "\r\n");
$socket->write("Content-Type: multipart/form-data; boundary=" . $this->boundary . "\r\n");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/encoding_test.php
Expand Up @@ -205,7 +205,7 @@ function testEmptyEncodingWritesZeroContentLength() {
function testEmptyMultipartEncodingWritesEndBoundaryContentLength() {
$socket = new MockSimpleSocket();
$socket->expectAt(0, 'write', array("Content-Length: 14\r\n"));
$socket->expectAt(1, 'write', array("Content-Type: multipart/form-data, boundary=boundary\r\n"));
$socket->expectAt(1, 'write', array("Content-Type: multipart/form-data; boundary=boundary\r\n"));
$encoding = new SimpleMultipartEncoding(array(), 'boundary');
$encoding->writeHeadersTo($socket);
}
Expand Down

0 comments on commit 21ca70f

Please sign in to comment.