Skip to content

Commit

Permalink
fixed error sending file > 1mb
Browse files Browse the repository at this point in the history
  • Loading branch information
TinderBox authored Oct 27, 2017
1 parent 355d144 commit 3eb3be0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Transport/HttpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@ public function sendAsyncFilesWithQuery(Server $server, string $query, array $fi
{
$requests = function ($files) use ($server, $query) {
foreach ($files as $file) {
$headers = array_merge($this->getHeaders(), [
'Content-Length' => null
]);


$request = new Request(
'POST', $this->buildRequestUri($server, ['query' => $query]), $this->getHeaders(), $this->getFileHandle($file)
'POST', $this->buildRequestUri($server, ['query' => $query]), $headers, $this->getFileHandle($file)
);

yield $request;
Expand All @@ -155,6 +160,7 @@ public function sendAsyncFilesWithQuery(Server $server, string $query, array $fi
'rejected' => $this->parseReason(),
'options' => [
'connect_timeout' => $server->getOptions()->getTimeout(),
'expect' => false
],
]
);
Expand Down Expand Up @@ -355,6 +361,7 @@ public function getAsync(Server $server, array $queries, int $concurrency = 5):
'rejected' => $this->parseReason(),
'options' => [
'connect_timeout' => $server->getOptions()->getTimeout(),
'expect' => false
],
]
);
Expand Down

0 comments on commit 3eb3be0

Please sign in to comment.