It seems that browser behave differently in case a CSP header is set on a 304 response.
E.g.:
- Chrome uses the cached CSP header instead of the CSP header provided in the 304 response.
- Firefox uses the CSP header provided in the 304 response instead of the cached CSP header.
In case of nonce based CSPs (which should change for every single response), Chrome's behavior doesn't break a site, if a CSP header with a new nonce is set on a 304.
While the preferred solution is probably to not set a CSP at all on 304s, it is likely that in practice not reusing the cached header will lead to (unexpected) breakages in a subset of browsers.
I think it would make sense to be consistent across browsers in handling CSP headers on 304s.