16 lines
419 B
C#
16 lines
419 B
C#
using Flypaper.Core;
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
namespace Flypaper.Http;
|
|
|
|
internal sealed class HttpTrapChannel(TrapSession session, HttpResponse response) : ITrapChannel
|
|
{
|
|
public TrapSession Session => session;
|
|
|
|
public async ValueTask WriteAsync(ReadOnlyMemory<byte> data, CancellationToken ct)
|
|
{
|
|
await response.Body.WriteAsync(data, ct);
|
|
await response.Body.FlushAsync(ct);
|
|
}
|
|
}
|