using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Hero
{
    public class HeaderHandler : IHttpModule
    {
        public void Dispose()
        {
            
        }

        public void Init(HttpApplication context)
        {
            context.EndRequest += new EventHandler(this.handle_EndRequest);
        }

        void handle_EndRequest(object sender,EventArgs e)
        {
            HttpResponse response = HttpContext.Current.Response;
            if(response!=null)
            {
                var responseHeaders = response.Headers;
                if(responseHeaders!=null)
                {
                    responseHeaders.Remove("Server");
                    responseHeaders.Remove("X-AspNet-Version");
                }
            }
        }
    }
}