-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
🚀 Feature request
Command (mark with an x)
- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
I want to set a response header for every request served by ng serve (e.g. Content-Security-Policy to make my local development environment more equal to the production environment.
Describe the solution you'd like
An option might be to be able to set headers within the angular.json's serve section
Describe alternatives you've considered
I tried to add a wildcard entry in the proxy.conf.js file (/**) and set the header within the onProxyRes method like so:
onProxyRes: (proxyRes, req, res) => {
proxyRes.headers['Content-Security-Policy'] = 'default-src \'self\' \'unsafe-eval\' \'unsafe-inline\'';
}
But this method does not get triggered.
Metadata
Metadata
Assignees
Labels
No labels