Skip to content

Commit

Permalink
Fixed a bug in the Nancy & AspNetCore client where the port was being…
Browse files Browse the repository at this point in the history
… set to 0.
  • Loading branch information
niemyjski committed Feb 6, 2019
1 parent 6073a8d commit c03b5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/Exceptionless.Nancy/RequestInfoCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c03b5d3

Please sign in to comment.