fix: return empty string if null

This commit is contained in:
nikita
2025-01-24 17:10:46 +03:00
parent 56c7196100
commit 7eb307b65e

View File

@ -95,7 +95,7 @@ public static class LoggerConfiguration
diagnosticContext.Set("RequestHost", httpContext.Request.Host.Value);
diagnosticContext.Set("RequestScheme", httpContext.Request.Scheme);
diagnosticContext.Set("UserAgent", httpContext.Request.Headers.UserAgent);
diagnosticContext.Set("RemoteIPAddress", httpContext.Connection.RemoteIpAddress?.ToString());
diagnosticContext.Set("RemoteIPAddress", httpContext.Connection.RemoteIpAddress?.ToString() ?? string.Empty);
};
});
}