From 09d0969e94f04f0faf09abdf4a6bf08571bb23c2 Mon Sep 17 00:00:00 2001 From: Alex Macocian Date: Tue, 13 Aug 2024 15:55:21 +0200 Subject: [PATCH] Fix live-feed client removal --- GuildWarsPartySearch/Endpoints/LiveFeed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GuildWarsPartySearch/Endpoints/LiveFeed.cs b/GuildWarsPartySearch/Endpoints/LiveFeed.cs index 656cf46..8f31ac5 100644 --- a/GuildWarsPartySearch/Endpoints/LiveFeed.cs +++ b/GuildWarsPartySearch/Endpoints/LiveFeed.cs @@ -56,8 +56,8 @@ public override async Task SocketAccepted(CancellationToken cancellationToken) public override Task SocketClosed() { - var ipAddress = this.Context?.Connection.RemoteIpAddress?.ToString(); - var scopedLogger = this.logger.CreateScopedLogger(nameof(this.SocketAccepted), ipAddress ?? string.Empty); + var ipAddress = this.Context?.Request.HttpContext.GetClientIP(); + var scopedLogger = this.logger.CreateScopedLogger(nameof(this.SocketClosed), ipAddress ?? string.Empty); this.liveFeedService.RemoveClient(this.WebSocket!, ipAddress); scopedLogger.LogDebug("Client removed from livefeed"); return Task.CompletedTask;