Skip to content

Commit

Permalink
Request without host throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Kudriashov authored and fedj committed May 14, 2018
1 parent f52cdc6 commit 8e73b3c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public static class TracingMiddleware
Trace.Current = trace;
using (var serverTrace = new ServerTrace(serviceName, getRpc(context)))
{
trace.Record(Annotations.Tag("http.host", request.Host.ToString()));
if (request.Host.HasValue)
{
trace.Record(Annotations.Tag("http.host", request.Host.ToString()));
}
trace.Record(Annotations.Tag("http.uri", UriHelper.GetDisplayUrl(request)));
trace.Record(Annotations.Tag("http.path", request.Path));
await serverTrace.TracedActionAsync(next());
Expand Down

0 comments on commit 8e73b3c

Please sign in to comment.