summaryrefslogtreecommitdiff
path: root/ext/standard/tests/http/http_response_header_01.phpt
blob: d364ebd1532a11f41d3194371fb4a6d5f8cf151e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--TEST--
$http_reponse_header (no redirect)
--SKIPIF--
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:22346'); ?>
--INI--
allow_url_fopen=1
--FILE--
<?php
require 'server.inc';

$responses = array(
	"data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\nSome: Header\r\n\r\nBody",
);

$pid = http_server("tcp://127.0.0.1:22346", $responses, $output);

function test() {
    $f = file_get_contents('http://127.0.0.1:22346/');
    var_dump($f);
    var_dump($http_response_header);
}
test();

http_server_kill($pid);
?>
==DONE==
--EXPECT--
string(4) "Body"
array(3) {
  [0]=>
  string(15) "HTTP/1.0 200 Ok"
  [1]=>
  string(12) "Some: Header"
  [2]=>
  string(12) "Some: Header"
}
==DONE==