serilog-sinks-browserhttp icon indicating copy to clipboard operation
serilog-sinks-browserhttp copied to clipboard

Request authentication and/or filtering

Open nblumhardt opened this issue 5 years ago • 0 comments

By default, the /ingest endpoint will accept any payload it receives. We could implement a request validation callback to filter out unauthenticated or otherwise unacceptable requests, e.g.:

app.UseSerilogIngestion(options => {
    // Just deny everything :-)
    options.OnIngestingAsync = async httpContext => httpContext.Response.StatusCode = 401;
});

nblumhardt avatar Nov 09 '19 23:11 nblumhardt