Skip to content

Commit

Permalink
Fixed setting baseUrl on request when using concurrently with as
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsenmaqsudi committed Apr 10, 2022
1 parent f5ba42b commit 81f1047
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Request.php
Expand Up @@ -4,7 +4,6 @@

namespace JustSteveKing\Transporter;

use GuzzleHttp\Promise\Promise;
use Illuminate\Http\Client\Pool;
use JustSteveKing\StatusCode\Http;
use OutOfBoundsException;
Expand Down Expand Up @@ -299,7 +298,7 @@ public function setPath(string $path): static
}

/**
* @param Pool $pool
* @param Pool|null $pool
*/
private function ensureRequest(null|Pool $pool = null): void
{
Expand All @@ -310,9 +309,11 @@ private function ensureRequest(null|Pool $pool = null): void
);
} else {
$this->request = match ($this->as === null) {
false => $pool->as(
key: $this->as
),
false => $pool
->as(key: $this->as)
->baseUrl(
url: $this->baseUrl ?? config('transporter.base_uri') ?? '',
),
true => $pool->baseUrl(
url: $this->baseUrl ?? config('transporter.base_uri') ?? '',
)
Expand Down

0 comments on commit 81f1047

Please sign in to comment.