Currently I am cloning request to add some parameter like this:
const modifiedReq = req.clone(
{
params: new HttpParams().set('MYPARAM', MyParamValue),
})
Now, to the same request I want to add this in header section:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
How can I add this?
Update:
I am aware of setting header just like this example:
request = request.clone({
setHeaders:
{
Authorization: `Bearer ${token}`
}
});
This way 'Content-Type' etc can be set. But in my example above, there is something meta is set inside which there are paremeters http-equiv and content which I don't know how to set.
(Additional info: This I am adding in header to allow to mix secure & non-secure requests)
http-equivis just an attribute that allow us frontend developers to emulate HTTP headers. If you want to have this sent as part of the request, you do not need to add it to the header. What matters is value ofhttp-equivand value ofcontent. Here's a bit of documentation that might shed some light: developer.mozilla.org/en-US/docs/Web/HTML/Element/meta