summaryrefslogtreecommitdiff
path: root/ext/standard/tests/http/bug79265_2.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/http/bug79265_2.phpt')
-rw-r--r--ext/standard/tests/http/bug79265_2.phpt38
1 files changed, 38 insertions, 0 deletions
diff --git a/ext/standard/tests/http/bug79265_2.phpt b/ext/standard/tests/http/bug79265_2.phpt
new file mode 100644
index 0000000000..d2f5bc1e38
--- /dev/null
+++ b/ext/standard/tests/http/bug79265_2.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Bug #79265 variation: "host:" not at start of header
+--INI--
+allow_url_fopen=1
+--SKIPIF--
+<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
+--FILE--
+<?php
+require 'server.inc';
+
+$responses = array(
+ "data://text/plain,HTTP/1.0 200 OK\r\n\r\n",
+);
+
+$pid = http_server("tcp://127.0.0.1:12342", $responses, $output);
+
+$opts = array(
+ 'http'=>array(
+ 'method'=>"GET",
+ 'header'=>"RandomHeader: host:8080\r\n" .
+ "Cookie: foo=bar\r\n"
+ )
+);
+$context = stream_context_create($opts);
+$fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context);
+fseek($output, 0, SEEK_SET);
+echo stream_get_contents($output);
+fclose($fd);
+
+http_server_kill($pid);
+
+?>
+--EXPECT--
+GET / HTTP/1.0
+Host: 127.0.0.1:12342
+Connection: close
+RandomHeader: host:8080
+Cookie: foo=bar