helpscout / proxypack

🎭ProxyPack: Proxy Local Webpack Assets to your Production Domain
MIT License
6 stars 1 forks source link

Don't add CSP headers if they don't exist #8

Closed tjbo closed 5 years ago

tjbo commented 5 years ago

Previously we we're creating CSP headers, even they didn't exist on the previous request. https://github.com/helpscout/proxypack/compare/v0.1.7...v0.1.8

In this fix, we first check if the headers exist before merging them in. This would means that since the local domain works without the header that CSP is OptIn, and hence we only need to add it when it has already been added.