Skip to content

Commit 24936f6

Browse files
committed
Leverage str_ends_with
added the php80 polyfill to requirements when necessary
1 parent 343ba5b commit 24936f6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ private static function configureHeadersAndProxy($context, string $host, array $
460460
foreach ($noProxy as $rule) {
461461
$dotRule = '.'.ltrim($rule, '.');
462462

463-
if ('*' === $rule || $host === $rule || substr($host, -\strlen($dotRule)) === $dotRule) {
463+
if ('*' === $rule || $host === $rule || str_ends_with($host, $dotRule)) {
464464
stream_context_set_option($context, 'http', 'proxy', null);
465465
stream_context_set_option($context, 'http', 'request_fulluri', false);
466466
stream_context_set_option($context, 'http', 'header', $requestHeaders);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"psr/log": "^1|^2|^3",
2626
"symfony/http-client-contracts": "^1.1.10|^2",
2727
"symfony/polyfill-php73": "^1.11",
28+
"symfony/polyfill-php80": "^1.16",
2829
"symfony/service-contracts": "^1.0|^2"
2930
},
3031
"require-dev": {

0 commit comments

Comments
 (0)