Solved

webconfig question

Posted on 2014-10-22
6
117 Views
Last Modified: 2014-11-09
Hi

What is the role of <clear/> in below code snipped and will it have any effect on functionality of <add name="X-XSS-Protection" value="1"/>


<httpProtocol>
      <customHeaders>
        <clear/>
        <add name="X-Frame-Options" value="DENY"/>
        <add name="X-XSS-Protection" value="1"/>
      </customHeaders>
    </httpProtocol>

Open in new window



Thanks
meetDinesh
0
Comment
Question by:Dinesh Kumar
  • 4
  • 2
6 Comments
 
LVL 27

Expert Comment

by:Dan McFadden
ID: 40396579
It removes all previously declared options.

Reference link:  http://msdn.microsoft.com/en-us/library/aa903345(v=vs.71).aspx

Dan
0
 

Author Comment

by:Dinesh Kumar
ID: 40396613
1. in my case, I see that I  am having <customHeaders> only once, do <clear/>
 solve any purpose or can I safely remove it?

2. If I remove it I want to ensure that, the following should not affect in any way:

 <add name="X-XSS-Protection" value="1"/>
0
 
LVL 27

Expert Comment

by:Dan McFadden
ID: 40396627
In your example config, clear would remove any previously declared (and inherited) keys from your application.  Only the defined keys after the clear will be used.

If you remove it, any upstream (parent) configuration will be included in your app.  But declaring this in your web.config should override anything that inherited.

Dan
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 27

Expert Comment

by:Dan McFadden
ID: 40396632
You can also read thru the article.  Maybe it will make it clearer for you:

http://stackoverflow.com/questions/7626440/web-config-clear

Dan
0
 

Author Comment

by:Dinesh Kumar
ID: 40396697
in my case, it will override  <customHeaders>
defined in machine config?

as I see there is one tag only in  web.config <customHeaders>
0
 
LVL 27

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 40396723
A clear will remove the customHeaders config section from the web app that uses the configuration above in its web.config.

Then only your X-Frame-Options and X-XSS-Protection items will be used.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question