@@ -85,6 +85,39 @@ public function testPostRequestMethod() {
85
85
)) === 'POST ' );
86
86
}
87
87
88
+ public function testPostContinueResponse () {
89
+ // 100 Continue responses may contain additional optional headers per
90
+ // RFC 2616, Section 10.1:
91
+ // This class of status code indicates a provisional response,
92
+ // consisting only of the Status-Line and optional headers, and is
93
+ // terminated by an empty line.
94
+ $ response =
95
+ 'HTTP/1.1 100 Continue ' . "\r\n" .
96
+ 'Date: Fri, 01 Jan 1990 00:00:00 GMT ' . "\r\n" .
97
+ 'Server: PHP-Curl-Class ' . "\r\n" .
98
+ "\r\n" .
99
+ 'HTTP/1.1 200 OK ' . "\r\n" .
100
+ 'Date: Fri, 01 Jan 1990 00:00:00 GMT ' . "\r\n" .
101
+ 'Cache-Control: private ' . "\r\n" .
102
+ 'Vary: Accept-Encoding ' . "\r\n" .
103
+ 'Content-Length: 2 ' . "\r\n" .
104
+ 'Content-Type: text/plain;charset=UTF-8 ' . "\r\n" .
105
+ 'Server: PHP-Curl-Class ' . "\r\n" .
106
+ 'Connection: keep-alive ' . "\r\n" .
107
+ "\r\n" .
108
+ 'OK ' ;
109
+
110
+ $ reflector = new ReflectionClass ('Curl ' );
111
+ $ reflection_method = $ reflector ->getMethod ('parseResponse ' );
112
+ $ reflection_method ->setAccessible (true );
113
+
114
+ $ curl = new Curl ();
115
+ list ($ response_headers , $ response ) = $ reflection_method ->invoke ($ curl , $ response );
116
+
117
+ $ this ->assertEquals ($ response_headers ['Status-Line ' ], 'HTTP/1.1 200 OK ' );
118
+ $ this ->assertEquals ($ response , 'OK ' );
119
+ }
120
+
88
121
public function testPostData () {
89
122
$ test = new Test ();
90
123
$ this ->assertTrue ($ test ->server ('post ' , 'POST ' , array (
0 commit comments