From 9a41f6b18c6e6e6ff8cdb34f4e82e11481d5ec9b Mon Sep 17 00:00:00 2001 From: Jozef Rebjak Date: Mon, 26 Jun 2023 13:52:36 +0200 Subject: [PATCH] test: add testSendProxied --- tests/system/HTTP/CURLRequestTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php index 92c43cc584..41ebee3073 100644 --- a/tests/system/HTTP/CURLRequestTest.php +++ b/tests/system/HTTP/CURLRequestTest.php @@ -718,6 +718,18 @@ final class CURLRequestTest extends CIUnitTestCase $this->assertSame('Hi there', $response->getBody()); } + public function testSendProxied() + { + $request = $this->getRequest([ + 'base_uri' => 'http://www.foo.com/api/v1/', + 'delay' => 100, + ]); + + $request->setOutput("HTTP/1.1 200 Connection established:\x0d\x0a\x0d\x0aHi there"); + $response = $request->get('answer'); + $this->assertSame('Hi there', $response->getBody()); + } + /** * See: https://github.com/codeigniter4/CodeIgniter4/issues/3261 */