File tree 1 file changed +5
-2
lines changed
Filter options
src/Symfony/Component/HttpClient
1 file changed +5
-2
lines changed
Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ public function request(string $method, string $url, array $options = []): Respo
311
311
}
312
312
313
313
foreach ($ curlopts as $ opt => $ value ) {
314
- if (null !== $ value && !curl_setopt ($ ch , $ opt , $ value ) && \CURLOPT_CERTINFO !== $ opt ) {
314
+ if (null !== $ value && !curl_setopt ($ ch , $ opt , $ value ) && \CURLOPT_CERTINFO !== $ opt && (! \defined ( ' CURLOPT_HEADEROPT ' ) || \ CURLOPT_HEADEROPT !== $ opt ) ) {
315
315
$ constantName = $ this ->findConstantName ($ opt );
316
316
throw new TransportException (sprintf ('Curl option "%s" is not supported. ' , $ constantName ?? $ opt ));
317
317
}
@@ -574,7 +574,6 @@ private function validateExtraCurlOptions(array $options): void
574
574
\CURLOPT_HEADER ,
575
575
\CURLOPT_CONNECTTIMEOUT ,
576
576
\CURLOPT_CONNECTTIMEOUT_MS ,
577
- \CURLOPT_HEADEROPT ,
578
577
\CURLOPT_HTTP_VERSION ,
579
578
\CURLOPT_PORT ,
580
579
\CURLOPT_DNS_USE_GLOBAL_CACHE ,
@@ -588,6 +587,10 @@ private function validateExtraCurlOptions(array $options): void
588
587
$ curloptsToCheck [] = \CURLOPT_HTTP09_ALLOWED ;
589
588
}
590
589
590
+ if (\defined ('CURLOPT_HEADEROPT ' )) {
591
+ $ curloptsToCheck [] = \CURLOPT_HEADEROPT ;
592
+ }
593
+
591
594
$ methodOpts = [
592
595
\CURLOPT_POST ,
593
596
\CURLOPT_PUT ,
You can’t perform that action at this time.
0 commit comments