public override void Write(byte[] buffer, int offset, int count) { if (IsHtmlResponse()) { WebsocketScriptInjectionHelper.InjectLiveReloadScriptAsync(buffer, offset, count, _context, _baseStream) .GetAwaiter() .GetResult(); } else { _baseStream.Write(buffer, offset, count); } }
public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { if (IsHtmlResponse()) { await WebsocketScriptInjectionHelper.InjectLiveReloadScriptAsync( buffer, offset, count, _context, _baseStream); } else { await _baseStream.WriteAsync(buffer, offset, count, cancellationToken); } }