diff --git a/src/Platforms/Exceptionless.AspNetCore/RequestInfoCollector.cs b/src/Platforms/Exceptionless.AspNetCore/RequestInfoCollector.cs index beb13ca3..044f6fa8 100644 --- a/src/Platforms/Exceptionless.AspNetCore/RequestInfoCollector.cs +++ b/src/Platforms/Exceptionless.AspNetCore/RequestInfoCollector.cs @@ -30,8 +30,7 @@ public static RequestInfo Collect(HttpContext context, ExceptionlessConfiguratio if (!String.IsNullOrEmpty(context.Request.Host.Host)) info.Host = context.Request.Host.Host; - if (context.Request.Host.Port.HasValue) - info.Port = context.Request.Host.Port.Value; + info.Port = context.Request.Host.Port.GetValueOrDefault(info.IsSecure ? 443 : 80); if (context.Request.Headers.ContainsKey(HeaderNames.UserAgent)) info.UserAgent = context.Request.Headers[HeaderNames.UserAgent].ToString(); @@ -46,9 +45,8 @@ public static RequestInfo Collect(HttpContext context, ExceptionlessConfiguratio if (config.IncludeQueryString) info.QueryString = context.Request.Query.ToDictionary(exclusionList); - if (config.IncludePostData) { + if (config.IncludePostData) info.PostData = GetPostData(context, config, exclusionList); - } return info; } diff --git a/src/Platforms/Exceptionless.Nancy/RequestInfoCollector.cs b/src/Platforms/Exceptionless.Nancy/RequestInfoCollector.cs index 442465ea..be596533 100644 --- a/src/Platforms/Exceptionless.Nancy/RequestInfoCollector.cs +++ b/src/Platforms/Exceptionless.Nancy/RequestInfoCollector.cs @@ -27,7 +27,7 @@ public static RequestInfo Collect(NancyContext context, ExceptionlessConfigurati info.Host = context.Request.Url.HostName; info.IsSecure = context.Request.Url.IsSecure; info.Path = context.Request.Url.BasePath + context.Request.Url.Path; - info.Port = context.Request.Url.Port ?? 80; + info.Port = context.Request.Url.Port.GetValueOrDefault(info.IsSecure ? 443 : 80); } if (!String.IsNullOrWhiteSpace(context.Request.Headers.Referrer))