Skip to content

Commit a20365b

Browse files
committed
test: improve testSendProxied
1 parent 8d023d9 commit a20365b

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

tests/system/HTTP/CURLRequestTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -718,18 +718,6 @@ public function testSendContinued()
718718
$this->assertSame('Hi there', $response->getBody());
719719
}
720720

721-
public function testSendProxied()
722-
{
723-
$request = $this->getRequest([
724-
'base_uri' => 'http://www.foo.com/api/v1/',
725-
'delay' => 100,
726-
]);
727-
728-
$request->setOutput("HTTP/1.1 200 Connection established\x0d\x0a\x0d\x0aHi there");
729-
$response = $request->get('answer');
730-
$this->assertSame('Hi there', $response->getBody());
731-
}
732-
733721
/**
734722
* See: https://github.com/codeigniter4/CodeIgniter4/issues/3261
735723
*/
@@ -777,6 +765,21 @@ public function testSendContinuedWithManyHeaders()
777765
$this->assertSame(200, $response->getStatusCode());
778766
}
779767

768+
public function testSendProxied()
769+
{
770+
$request = $this->getRequest([
771+
'base_uri' => 'http://www.foo.com/api/v1/',
772+
'delay' => 100,
773+
]);
774+
775+
$output = "HTTP/1.1 200 Connection established
776+
Proxy-Agent: Fortinet-Proxy/1.0\x0d\x0a\x0d\x0aHTTP/1.1 200 OK\x0d\x0a\x0d\x0aHi there";
777+
$request->setOutput($output);
778+
779+
$response = $request->get('answer');
780+
$this->assertSame('Hi there', $response->getBody());
781+
}
782+
780783
/**
781784
* See: https://github.com/codeigniter4/CodeIgniter4/issues/7394
782785
*/

0 commit comments

Comments
 (0)