TsgcWebSocketFirewall › Properties › PayloadLimit
Rejects inbound messages whose size exceeds MaxSizeBytes to protect against oversized payload attacks.
property PayloadLimit: TsgcFirewallPayloadLimit read FPayloadLimit write SetPayloadLimit;
—
Enable PayloadLimit.Enabled to enforce a per-message size cap measured in bytes. Messages larger than MaxSizeBytes are blocked and OnViolation fires with type fvPayloadSize. Action controls the response: faDeny rejects the message, faAllow forwards it and faLog only records the violation. Matches feed ThreatScore through WeightPayloadSize. This is independent from WebSocketProtection.MaxFrameSize, which enforces a per-frame cap at the WebSocket layer. Defaults: MaxSizeBytes=1048576 (1 MB), Action=faDeny.
sgcWebSocketFirewall1.PayloadLimit.Enabled := True;
sgcWebSocketFirewall1.PayloadLimit.MaxSizeBytes := 65536;
sgcWebSocketFirewall1.PayloadLimit.Action := faDeny;