private async Task SendMessageAsync(RequestMessage message) { if (_sessionEnabled) { message = RebuildSessionMessage(message); } var serializedMsg = await _messageSerializer.SerializeMessageAsync(message).ConfigureAwait(false); await _webSocketConnection.SendMessageAsync(serializedMsg).ConfigureAwait(false); }
private async Task SendMessageAsync(RequestMessage message) { if (_sessionEnabled) { message = RebuildSessionMessage(message); } var serializedMsg = await _messageSerializer.SerializeMessageAsync(message).ConfigureAwait(false); #if NET6_0_OR_GREATER if (message.Processor == Tokens.OpsAuthentication) { // Don't compress a message that contains credentials to prevent attacks like CRIME or BREACH await _webSocketConnection.SendMessageUncompressedAsync(serializedMsg).ConfigureAwait(false); return; } #endif await _webSocketConnection.SendMessageAsync(serializedMsg).ConfigureAwait(false); }