Table of Contents

TTMSMCPGetCustomHeaderEvent Event Type

Inspects an incoming request and decides whether it may go on to be handled.

API unit family: TMS.MCP.Transport.StreamableHTTP

Remarks

Despite the name this is a gate on the way in, not a way of supplying a header. It is where a shared secret, an API key or any other custom header condition is enforced. TTMSMCPSetCustomHeaderEvent is its counterpart on the way out. It runs before the request path, the origin and any bearer token are checked, so it sees every request that reaches the channel, whatever it is addressed to. It runs on a connection thread and blocks the request, so keep it fast and safe to run concurrently.

Parameters

Name Description
Sender Channel that received the request.
ARequest The request, for reading its headers and address. Read TTMSMCPHTTPServerHeaders.Get for a header value.
AAllow Whether the request may proceed. Passed in as True; set it to False to reject the request, which is answered 403 and never reaches the protocol handler.
AErrorMessage Reason for a rejection, returned to the client in the answer. Leave empty to return a generic message. Ignored when the request is allowed.