diff --git a/src/MultipartStreamBuilder.php b/src/MultipartStreamBuilder.php index 4bf426f..5e7c693 100644 --- a/src/MultipartStreamBuilder.php +++ b/src/MultipartStreamBuilder.php @@ -91,7 +91,7 @@ public function build() $streams = ''; foreach ($this->data as $data) { // Add start and headers - $streams .= "--{$this->getBoundary()}\r\n". + $streams .= "--\"{$this->getBoundary()}\"\r\n". $this->getHeaders($data['headers'])."\r\n"; // Convert the stream to string @@ -100,7 +100,7 @@ public function build() } // Append end - $streams .= "--{$this->getBoundary()}--\r\n"; + $streams .= "--\"{$this->getBoundary()}\"--\r\n"; return $this->streamFactory->createStream($streams); } @@ -185,7 +185,7 @@ private function hasHeader(array $headers, $key) public function getBoundary() { if ($this->boundary === null) { - $this->boundary = uniqid(); + $this->boundary = uniqid('', true); } return $this->boundary;