TsgcWSAPIServer_WebAuthnEvents › OnWebAuthnHTTPResponse

OnWebAuthnHTTPResponse 事件

在服务器为 WebAuthn 端点构建 HTTP 响应后、发送之前触发;用于审计或装饰传出载荷和标头。

语法

property OnWebAuthnHTTPResponse: TsgcWebAuthnOnHTTPResponse;
// TsgcWebAuthnOnHTTPResponse = procedure(Sender: TObject; aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest; const aResponse: TsgcHTTPResponse) of object

默认值

备注

OnWebAuthnHTTPRequest 的配套事件。在响应离开服务器之前,携带最终的 aResponse(状态码、头部和正文)以及原始的 aRequest 和标识端点的 aMethod 触发。典型用途包括访问日志记录、指标统计、添加自定义安全头或将响应写入审计跟踪。

示例

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnHTTPResponse(Sender: TObject;
  aMethod: TsgcWebAuthnHTTPRequestMethod; const aRequest: TsgcHTTPRequest;
  const aResponse: TsgcHTTPResponse);
begin
  Memo1.Lines.Add(Format('WebAuthn %d %s', [aResponse.ResponseCode, aRequest.URI]));
end;

返回事件