8000 always set CURLOPT_CUSTOMREQUEST to the correct HTTP method · symfony/symfony@552f861 · GitHub
[go: up one dir, main page]

Skip to content

Commit 552f861

Browse files
committed
always set CURLOPT_CUSTOMREQUEST to the correct HTTP method
1 parent 67c835e commit 552f861

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,12 @@ public function request(string $method, string $url, array $options = []): Respo
197197
$curlopts[\CURLOPT_RESOLVE] = $resolve;
198198
}
199199

200+
$curlopts[\CURLOPT_CUSTOMREQUEST] = $method;
200201
if ('POST' === $method) {
201202
// Use CURLOPT_POST to have browser-like POST-to-GET redirects for 301, 302 and 303
202203
$curlopts[\CURLOPT_POST] = true;
203204
} elseif ('HEAD' === $method) {
204205
$curlopts[\CURLOPT_NOBODY] = true;
205-
} else {
206-
$curlopts[\CURLOPT_CUSTOMREQUEST] = $method;
207206
}
208207

209208
if ('\\' !== \DIRECTORY_SEPARATOR && $options['timeout'] < 1) {

0 commit comments

Comments
 (0)
0