What security risks exist when setting Access-Control-Allow-Origin to accept all domains?

By responding with Access-Control-Allow-Origin: *, the requested resource allows sharing with every origin. This basically means that any site can send an XHR request to your site and access the server’s response which would not be the case if you hadn’t implemented this CORS response. So any site can make a request to your site … Read more

Setting HTTP headers

Never mind, I figured it out – I used the Set() method on Header() (doh!) My handler looks like this now: func saveHandler(w http.ResponseWriter, r *http.Request) { // allow cross domain AJAX requests w.Header().Set(“Access-Control-Allow-Origin”, “*”) } Maybe this will help someone as caffeine deprived as myself sometime 🙂

How to remove ASP.Net MVC Default HTTP Headers?

X-Powered-By is a custom header in IIS. Since IIS 7, you can remove it by adding the following to your web.config: <system.webServer> <httpProtocol> <customHeaders> <remove name=”X-Powered-By” /> </customHeaders> </httpProtocol> </system.webServer> This header can also be modified to your needs, for more information refer to http://www.iis.net/ConfigReference/system.webServer/httpProtocol/customHeaders Add this to web.config to get rid of the X-AspNet-Version … Read more