Closed kraftner closed 4 years ago
@kraftner thanks for the feeback. in most of my plugins i follow a rule like this "if the plugin does something that is not needed 100% then disable it in debug mode – debug is not production" (like caches or other optimizations). this is based on my own preference to have debug OFF in local development until i encounter a crash, then turning it ON until i fix the issue. so for me having debug enabled is a rare case. but i understand that this might not be how others see it.
so apart from how to setup local dev config files why exactly do you need debug and the csp enabled at the same time?
I can totally understand that having debug enabled is a matter of taste, but since tastes obviously differ I was just hoping to make this plugin flexible enough to have it easily cater to all. :)
Personally I have two main reasons:
i added a new value 'force'
.
return [
'debug' => true,
'bnomei.securityheaders.enabled' => 'force',
// other options...
];
I'd like to have this plugin enabled during development to not only spot possible breakage through CSP issues in production. But currently setting
'debug' => true
always disables it.I have two ideas how to solve this:
debug
it could be used to set the default forenable
. But this would change the behavior for people already using the plugin. :cry:debug
option configurable just likeenabled
asbnomei.securityheaders.debug
so it can have a different value than the globaldebug
option.As a temporary workaround I use this code/configuration for my dev setup: