Skip to content

Commit 6fd504e

Browse files
authored
Use uniqid('', true) for performance reasons (#28)
1 parent af03e22 commit 6fd504e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MultipartStreamBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function build()
9191
$streams = '';
9292
foreach ($this->data as $data) {
9393
// Add start and headers
94-
$streams .= "--{$this->getBoundary()}\r\n".
94+
$streams .= "--\"{$this->getBoundary()}\"\r\n".
9595
$this->getHeaders($data['headers'])."\r\n";
9696

9797
// Convert the stream to string
@@ -107,7 +107,7 @@ public function build()
107107
}
108108

109109
// Append end
110-
$streams .= "--{$this->getBoundary()}--\r\n";
110+
$streams .= "--\"{$this->getBoundary()}\"--\r\n";
111111

112112
return $this->streamFactory->createStream($streams);
113113
}
@@ -192,7 +192,7 @@ private function hasHeader(array $headers, $key)
192192
public function getBoundary()
193193
{
194194
if ($this->boundary === null) {
195-
$this->boundary = uniqid();
195+
$this->boundary = uniqid('', true);
196196
}
197197

198198
return $this->boundary;

0 commit comments

Comments
 (0)