forked from codeofalltrades/veil-stats-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobal.asax.cs
45 lines (42 loc) · 1.58 KB
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace VeilStats
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
MvcHandler.DisableMvcResponseHeader = true;
}
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
//var app = sender as HttpApplication;
//var acceptEncoding = app.Request.Headers["Accept-Encoding"];
//var prevUncompressedStream = app.Response.Filter;
//if (!string.IsNullOrEmpty(acceptEncoding))
//{
// acceptEncoding = acceptEncoding.ToLower();
// if (acceptEncoding.Contains("gzip"))
// {
// app.Response.Filter = new GZipStream(prevUncompressedStream, CompressionMode.Compress);
// app.Response.AppendHeader("Content-Encoding", "gzip");
// }
//}
//Response.Cache.VaryByHeaders["Accept-Encoding"] = true;
}
protected void Application_OnSessionStart(object sender, EventArgs e)
{
HttpContext.Current.Session.Add("IsTestnet", false);
}
}
}