Skip to content

Commit 39b84dc

Browse files
committed
pass the method to the request when callback
1 parent be9dea9 commit 39b84dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Http/Client/PendingRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ public function send(string $method, string $url, array $options = [])
911911

912912
if (! $response->successful()) {
913913
try {
914-
$shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException(), $this) : true;
914+
$shouldRetry = $this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $response->toException(), $this, $this->request->toPsrRequest()->getMethod()) : true;
915915
} catch (Exception $exception) {
916916
$shouldRetry = false;
917917

@@ -948,7 +948,7 @@ public function send(string $method, string $url, array $options = [])
948948
throw $exception;
949949
}
950950
}, $this->retryDelay ?? 100, function ($exception) use (&$shouldRetry) {
951-
$result = $shouldRetry ?? ($this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $exception, $this) : true);
951+
$result = $shouldRetry ?? ($this->retryWhenCallback ? call_user_func($this->retryWhenCallback, $exception, $this, $this->request->toPsrRequest()->getMethod()) : true);
952952

953953
$shouldRetry = null;
954954

0 commit comments

Comments
 (0)