-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.2
CodeIgniter4 Version
4.4.3
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache, cli-server
Database
No response
What happened?
Run test Controller:
<?php
namespace App\Controllers;
use Config\Services;
class Home extends BaseController
{
public function index(): string
{
echo '<pre>';
echo 'Local:' . PHP_EOL;
var_dump(response()->headers());
echo 'Curl:' . PHP_EOL;
var_dump(Services::curlrequest()->get('https://ya.ru/')->headers());
echo '</pre>';
exit;
// return view('welcome_message');
}
}See headers values, example:
// Local
["Content-Type"]=>
object(CodeIgniter\HTTP\Header)#40 (2) {
["name":protected]=>
string(12) "Content-Type"
["value":protected]=>
string(24) "text/html; charset=UTF-8"
}
// Curl
["Content-Type"]=>
object(CodeIgniter\HTTP\Header)#90 (2) {
["name":protected]=>
string(12) "Content-Type"
["value":protected]=>
string(25) " text/html; charset=UTF-8"
}
// Curl in Console tests
["Date"]=>
object(CodeIgniter\HTTP\Header)#93 (2) {
["name":protected]=>
string(4) "Date"
["value":protected]=>
" string(31) " Wed, 06 Dec 2023 08:39:51 GMT
}Curl response contains spaces, new lines.
Should I apply trim() to all headers before installing?
Expected Output
Headers values without spaces/new lines
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them