X-Powered-By keep showing when I leave it empty in config file
In Laravel config/secure-headers.php
/*
* X-Powered-By
*
* Note: it will not add to response header if the value is empty string.
*/
'x-powered-by' => '',
But in header it shows
X-Powered-By: PHP/7.2.28
If I change the value:
'x-powered-by' => config('app.name'),
Header shows:
X-Powered-By: PHP/7.2.28 X-Powered-By: Laraspace
And if I change the config to
'x-powered-by' => [
'enable' => false,
],
Now it shows:
X-Powered-By: PHP/7.2.28 X-Powered-By
I just want to hide/remove it completely or just show one line with set value in config file, could you please let me know how to do that?
not sure about your setup and i'm not a lara user but u might check https://www.php.net/manual/en/ini.core.php#ini.expose-php
I have the same issue. Have you found a workaround @hyquoccuong ?
composer.json (versions):
{
"bepsvpt/secure-headers": "v6.3.0",
"laravel/lumen-framework": "v5.8.13",
}
config/secure-headers.php
/*
* X-Powered-By
*
* Note: it will not add to response header if the value is empty string.
*/
'x-powered-by' => '',
Nvm, thanks @tobias-trozowski. In my case it was the php.ini
- verify that
expose_phpis On
php -i | grep expose
# expose_php => On => On
- set
expose_phpto Off inphp.ini
expose_php => Off => Off
- restart server and verify header is not shown
Close due to inactive.