diff --git a/src/Server/OneTrueError.App/Modules/Geolocation/EventHandlers/StorePositionFromNewReport.cs b/src/Server/OneTrueError.App/Modules/Geolocation/EventHandlers/StorePositionFromNewReport.cs index fbb69a98..bcbf300e 100644 --- a/src/Server/OneTrueError.App/Modules/Geolocation/EventHandlers/StorePositionFromNewReport.cs +++ b/src/Server/OneTrueError.App/Modules/Geolocation/EventHandlers/StorePositionFromNewReport.cs @@ -42,10 +42,10 @@ public async Task HandleAsync(ReportAddedToIncident e) if (string.IsNullOrEmpty(e.Report.RemoteAddress)) return; - //if (e.Report.RemoteAddress == "::1") - // return; - //if (e.Report.RemoteAddress == "127.0.0.1") - // return; + if (e.Report.RemoteAddress == "::1") + return; + if (e.Report.RemoteAddress == "127.0.0.1") + return; var request = WebRequest.CreateHttp("http://freegeoip.net/json/" + e.Report.RemoteAddress); try diff --git a/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs b/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs index 46caa5ee..0e0ee875 100644 --- a/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs +++ b/src/Server/OneTrueError.Web/Areas/Installation/Controllers/SetupController.cs @@ -68,7 +68,7 @@ public ActionResult Basics() } else { - model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", ""); + model.BaseUrl = Request.Url.ToString().Replace("installation/setup/basics/", "").Replace("localhost", "yourServerName"); ViewBag.NextLink = ""; } @@ -83,6 +83,11 @@ public ActionResult Basics(BasicsViewModel model) if (!model.BaseUrl.EndsWith("/")) model.BaseUrl += "/"; + if (model.BaseUrl.IndexOf("localhost", StringComparison.OrdinalIgnoreCase) != -1) + { + ModelState.AddModelError("BaseUrl", "Use the servers real DNS name instead of 'localhost'. If you don't the Ajax request wont work as CORS would be enforced by IIS."); + return View(model); + } settings.BaseUrl = new Uri(model.BaseUrl); settings.SupportEmail = model.SupportEmail; ConfigurationStore.Instance.Store(settings); diff --git a/src/Server/OneTrueError.Web/Web.config b/src/Server/OneTrueError.Web/Web.config index 5c64c5f1..47e681e2 100644 --- a/src/Server/OneTrueError.Web/Web.config +++ b/src/Server/OneTrueError.Web/Web.config @@ -2,7 +2,7 @@ - +