diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 1f057f4..dc97b5a 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1837 \ No newline at end of file +1839 \ No newline at end of file diff --git a/IISMainHandler/MainHandler.cs b/IISMainHandler/MainHandler.cs index 4d70c4b..1073fca 100644 --- a/IISMainHandler/MainHandler.cs +++ b/IISMainHandler/MainHandler.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Web; using System.Configuration; +using FLocal.Common; namespace FLocal.IISHandler { public class MainHandler : IHttpHandler { @@ -19,14 +20,19 @@ namespace FLocal.IISHandler { throw new HttpException(403, "You have come from the static page '" + referer + "'"); } - if(!FLocal.Common.Config.isInitialized) { - lock(typeof(FLocal.Common.Config)) { - if(!FLocal.Common.Config.isInitialized) { - FLocal.Common.Config.Init(ConfigurationManager.AppSettings); + if(!Config.isInitialized) { + lock(typeof(Config)) { + if(!Config.isInitialized) { + Config.Init(ConfigurationManager.AppSettings); } } } + Uri current = httpcontext.Request.Url; + if(!current.Host.EndsWith(Config.instance.BaseHost)) { + throw new FLocal.Core.FLocalException("Wrong host: " + current.Host + " (expected *" + Config.instance.BaseHost + ")"); + } + WebContext context = new WebContext(httpcontext); try { ISpecificHandler handler = HandlersFactory.getHandler(context);