http: add client info to OnResponse
This commit is contained in:
parent
c675cd221e
commit
810c6c913e
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ public sealed class HttpServer
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a request has been served a response.
|
/// Called when a request has been served a response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<HttpRequest, HttpResponse>? OnResponse;
|
public event Action<HttpRequest, HttpClientInfo, HttpResponse>? OnResponse;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a request causes an exception.
|
/// Called when a request causes an exception.
|
||||||
|
@ -160,7 +160,7 @@ public sealed class HttpServer
|
||||||
//Execute
|
//Execute
|
||||||
HttpResponse? response = (await Router.GetResponse(req, clientInfo, pathSpl)) ?? HttpResponse.NotFound("Router produced no response");
|
HttpResponse? response = (await Router.GetResponse(req, clientInfo, pathSpl)) ?? HttpResponse.NotFound("Router produced no response");
|
||||||
|
|
||||||
OnResponse?.Invoke(req, response);
|
OnResponse?.Invoke(req, clientInfo, response);
|
||||||
await response.WriteTo(httpStream).WaitAsync(Timeout);
|
await response.WriteTo(httpStream).WaitAsync(Timeout);
|
||||||
|
|
||||||
if (response is SwitchingProtocols swp)
|
if (response is SwitchingProtocols swp)
|
||||||
|
|
Loading…
Reference in a new issue