PHP  
 PHP_7_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/curl/tests/bug79033.phpt ('Bug #79033 (Curl timeout error with specific url and post)')

Script

1: <?php
2:
include 'server.inc';
3:
$host curl_cli_server_start();
4:
$ch curl_init();
5:
curl_setopt_array($ch, [
6:     
CURLOPT_URL => "{$host}/get.inc?test=post",
7:     
CURLOPT_POST => true,
8:     
CURLOPT_POSTFIELDS => [],
9:     
CURLINFO_HEADER_OUT => true,
10:     
CURLOPT_RETURNTRANSFER => true,
11: ]);
12:
var_dump(curl_exec($ch));
13:
var_dump(curl_getinfo($ch)["request_header"]);
14:
?>
15:

Expected

string(%d) "array(0) {
}
"
string(90) "POST /get.inc?test=post HTTP/1.1
Host: localhost:%d
Accept: */*
Content-Length: 0

"

Output

string(1355) "<?php
  $test = isset($_GET['test']) ? $_GET['test'] : null;
  switch($test) {
    case 'post':
      var_dump($_POST);
      break;
    case 'getpost':
      var_dump($_GET);
      var_dump($_POST);
      break;
    case 'referer':
      echo $_SERVER['HTTP_REFERER'];
      break;
    case 'useragent':
      echo $_SERVER['HTTP_USER_AGENT'];
      break;
    case 'httpversion':
      echo $_SERVER['SERVER_PROTOCOL'];
      break;
    case 'cookie':
      echo $_COOKIE['foo'];
      break;
    case 'encoding':
      echo $_SERVER['HTTP_ACCEPT_ENCODING'];
      break;
    case 'contenttype':
      header('Content-Type: text/plain;charset=utf-8');
      break;
    case 'file':
      if (isset($_FILES['file'])) {
          echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'] . '|' . $_FILES['file']['size'];
      }
      break;
    case 'string_file':
      if (isset($_FILES['file'])) {
          if ($_FILES['file']['error'] === UPLOAD_ERR_OK) {
              echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'] . '|' . md5_file($_FILES['file']['tmp_name']);
          } else {
              echo 'error:' . $_FILES['file']['error'];
          }
      }
      break;
    case 'method':
      echo $_SERVER['REQUEST_METHOD'];
      break;
    default:
      echo "Hello World!\n";
      echo "Hello World!";
      break;
  }
?>
"
string(98) "POST /responder/get.inc?test=post HTTP/1.1
Host: gcov.php.net
Accept: */*
Content-Length: 0

"

Diff

001+ string(1355) "<?php
002+   $test = isset($_GET['test']) ? $_GET['test'] : null;
003+   switch($test) {
004+     case 'post':
005+       var_dump($_POST);
006+       break;
007+     case 'getpost':
008+       var_dump($_GET);
009+       var_dump($_POST);
001- string(%d) "array(0) {
002- }
003- "
004- string(90) "POST /get.inc?test=post HTTP/1.1
005- Host: localhost:%d
006- Accept: */*
007- Content-Length: 0
008- 
009- "
010+       break;
011+     case 'referer':
012+       echo $_SERVER['HTTP_REFERER'];
013+       break;
014+     case 'useragent':
015+       echo $_SERVER['HTTP_USER_AGENT'];
016+       break;
017+     case 'httpversion':
018+       echo $_SERVER['SERVER_PROTOCOL'];
019+       break;
020+     case 'cookie':
021+       echo $_COOKIE['foo'];
022+       break;
023+     case 'encoding':
024+       echo $_SERVER['HTTP_ACCEPT_ENCODING'];
025+       break;
026+     case 'contenttype':
027+       header('Content-Type: text/plain;charset=utf-8');
028+       break;
029+     case 'file':
030+       if (isset($_FILES['file'])) {
031+           echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'] . '|' . $_FILES['file']['size'];
032+       }
033+       break;
034+     case 'string_file':
035+       if (isset($_FILES['file'])) {
036+           if ($_FILES['file']['error'] === UPLOAD_ERR_OK) {
037+               echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'] . '|' . md5_file($_FILES['file']['tmp_name']);
038+           } else {
039+               echo 'error:' . $_FILES['file']['error'];
040+           }
041+       }
042+       break;
043+     case 'method':
044+       echo $_SERVER['REQUEST_METHOD'];
045+       break;
046+     default:
047+       echo "Hello World!\n";
048+       echo "Hello World!";
049+       break;
050+   }
051+ ?>
052+ "
053+ string(98) "POST /responder/get.inc?test=post HTTP/1.1
054+ Host: gcov.php.net
055+ Accept: */*
056+ Content-Length: 0
057+ 
058+ "

 

Generated at Fri, 03 Dec 2021 18:13:45 +0000 (29 hours ago)

Copyright © 2005-2021 The PHP Group
All rights reserved.