I want to add httpHeader to my response
I thought to use this code:
private void AddCustomHeader()
{
if (string.IsNullOrEmpty(HttpContext.Response.Headers.Get("Access-Control-Allow-Origin")))
{
// Custom header
HttpContext.Response.AddHeader("Access-Control-Allow-Origin", "*");
}
}
But it will always fails on localhost when ran with VS_server
This operation requires IIS integrated pipeline mode.
What will happen if I add a header that already exists?
HttpContext.Response.AddHeader("name","value");