Add option to disable all secure headers - #4284
elgamal-ahmed wants to merge 1 commit into
Conversation
Signed-off-by: elgamal-ahmed <83829864+elgamal-ahmed@users.noreply.github.com>
19b7d31 to
a111478
Compare
|
Couldn't you just disable the filter? |
Yeah, that's fair. The filter's opt-in, so if you're not using it there's nothing to disable anyway. The scenario I had in mind is when SecureHeaders is set up as a default filter and you want it off for one environment or profile. You can do that with enabled: false, but that's a hard off since it drops the factory bean, so any route that still references SecureHeaders stops resolving. With disable: all the filter stays wired up and just doesn't add anything, so you can flip it in a single application-.yml without touching the filter list. It also won't quietly miss any new default headers that get added later, which was the main thing the original issue was asking for. That said, your call. If you don't think it's worth the extra config, I'm fine closing it. |
|
No, good point with default filters and then per route exceptions. |
Adds
disable: allsupport for the SecureHeaders filter so every secure header can be disabled without listing them individually.This applies to both global configuration and route filter arguments. The setting also takes precedence over explicitly enabled optional headers, while preserving any headers already present on the response.
Fixes gh-2932.