Skip to content

Commit 0e9821c

Browse files
committed
Do not change behavior if route is null, only if it's empty
1 parent c70dbcb commit 0e9821c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Hosting/Hosting/src/Internal/HostingMetrics.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ public void RequestEnd(string protocol, string scheme, string method, string? ro
6767

6868
// Add information gathered during request.
6969
tags.Add("http.response.status_code", GetBoxedStatusCode(statusCode));
70-
var httpRoute = route;
71-
if (string.IsNullOrEmpty(httpRoute))
70+
if (route != null)
7271
{
73-
httpRoute = "/";
72+
var httpRoute = (route == string.Empty) ? "/" : route;
73+
tags.Add("http.route", httpRoute);
7474
}
75-
tags.Add("http.route", httpRoute);
7675

7776
// Add before some built in tags so custom tags are prioritized when dealing with duplicates.
7877
if (customTags != null)

0 commit comments

Comments
 (0)