Skip to content

Commit 1ee2363

Browse files
authored
Merge pull request #16 from shoboske/remove-unnecessary-condition
Remove unnecessary if condition
2 parents 17a441e + 5b196ef commit 1ee2363

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Serilog.Enrichers.ClientInfo/Enrichers/ClientAgentEnricher.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,12 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
3939
return;
4040
}
4141

42-
#if NETFULL
43-
var agentName = httpContext.Request.Headers["User-Agent"];
44-
#else
4542
var agentName = httpContext.Request.Headers["User-Agent"];
46-
#endif
47-
4843

4944
var clientAgentProperty = new LogEventProperty(ClientAgentPropertyName, new ScalarValue(agentName));
5045
httpContext.Items.Add(ClientAgentItemKey, clientAgentProperty);
5146

5247
logEvent.AddPropertyIfAbsent(clientAgentProperty);
5348
}
5449
}
55-
}
50+
}

0 commit comments

Comments
 (0)