Skip to content

Commit de370b6

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: Bump license year Bump license year [HttpClient] Turn negative timeout to a very long timeout Features goes to 6.x branch fix lowest required PropertyInfo component release [Validator] throw when Constraint::_construct() has not been called Bump Symfony version to 5.3.14 Update VERSION for 5.3.13 Update CHANGELOG for 5.3.13 Bump Symfony version to 4.4.37 Update VERSION for 4.4.36 Update CONTRIBUTORS for 4.4.36 Update CHANGELOG for 4.4.36 Allow symfony/runtime plugin
2 parents 5e344f1 + 6799916 commit de370b6

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

HttpClientTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ private static function prepareRequest(?string $method, ?string $url, array $opt
159159

160160
// Finalize normalization of options
161161
$options['http_version'] = (string) ($options['http_version'] ?? '') ?: null;
162-
$options['timeout'] = (float) ($options['timeout'] ?? ini_get('default_socket_timeout'));
162+
if (0 > $options['timeout'] = (float) ($options['timeout'] ?? ini_get('default_socket_timeout'))) {
163+
$options['timeout'] = 172800.0; // 2 days
164+
}
165+
163166
$options['max_duration'] = isset($options['max_duration']) ? (float) $options['max_duration'] : 0;
164167

165168
return [$url, $options];

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018-2021 Fabien Potencier
1+
Copyright (c) 2018-2022 Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Tests/HttpClientTestCase.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,13 @@ public function testDebugInfoOnDestruct()
373373

374374
$this->assertNotEmpty($traceInfo['debug']);
375375
}
376+
377+
public function testNegativeTimeout()
378+
{
379+
$client = $this->getHttpClient(__FUNCTION__);
380+
381+
$this->assertSame(200, $client->request('GET', 'http://localhost:8057', [
382+
'timeout' => -1,
383+
])->getStatusCode());
384+
}
376385
}

0 commit comments

Comments
 (0)