mirror of
https://github.com/php/php-src.git
synced 2026-04-21 15:08:16 +02:00
c47b18a222
We must not set an empty mime structure as `CURLOPT_MIMEPOST`; instead we set it to `NULL` if `CURLOPT_POSTFIELDS` has been set to an empty array.
30 lines
604 B
PHP
30 lines
604 B
PHP
--TEST--
|
|
Bug #79033 (Curl timeout error with specific url and post)
|
|
--SKIPIF--
|
|
<?php include 'skipif.inc'; ?>
|
|
--FILE--
|
|
<?php
|
|
include 'server.inc';
|
|
$host = curl_cli_server_start();
|
|
$ch = curl_init();
|
|
curl_setopt_array($ch, [
|
|
CURLOPT_URL => "{$host}/get.inc?test=post",
|
|
CURLOPT_POST => true,
|
|
CURLOPT_POSTFIELDS => [],
|
|
CURLINFO_HEADER_OUT => true,
|
|
CURLOPT_RETURNTRANSFER => true,
|
|
]);
|
|
var_dump(curl_exec($ch));
|
|
var_dump(curl_getinfo($ch)["request_header"]);
|
|
?>
|
|
--EXPECTF--
|
|
string(%d) "array(0) {
|
|
}
|
|
"
|
|
string(90) "POST /get.inc?test=post HTTP/1.1
|
|
Host: localhost:%d
|
|
Accept: */*
|
|
Content-Length: 0
|
|
|
|
"
|