I have a problem with the X-Frame-Options HTTP header.
I use MVC 5, so the SAMEORIGIN option is automatically added to the headers for the Http responses.
I still want to use the default option, and I don't want to use the line below in Application_Start:
AntiForgeryConfig.SuppressXFrameOptionsHeader = true;
I would like to remove the X-Frame-Options header in some specific action at the controller level with this code:
base.HttpContext.Response.Headers.Remove("X-Frame-Options");
However, this does not work.
Do you know how to remove it?
Any help would be appreciated.
source share