Skip to content

Commit e076a56

Browse files
[9.x] Add default timeout and connection timeout for the HTTP Client (#40187)
* add default timeout and connection timeout for the HTTP client * Update PendingRequest.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 2beec5d commit e076a56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Illuminate/Http/Client/PendingRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ public function __construct(Factory $factory = null)
168168
$this->asJson();
169169

170170
$this->options = [
171+
'connect_timeout' => 10,
171172
'http_errors' => false,
173+
'timeout' => 30,
172174
];
173175

174176
$this->beforeSendingCallbacks = collect([function (Request $request, array $options, PendingRequest $pendingRequest) {

0 commit comments

Comments
 (0)