mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
### Motivation We currently mitigate against receiving an excessive numbers of RST_STREAM frames, empty DATA frames, or encountering stream errors in a given time window. Receiving excessive numbers of PING, SETTINGS, PRIORITY, ALTSVC, or ORIGIN frames also results in the endpoint performing unnecessary work. As such, this PR adds these five frames to the current rate-limiting mechanism. ### Modifications - Updated `DOSHeuristics` to also rate-limit PING, SETTINGS, PRIORITY, ALTSVC, and ORIGIN frames. - Added a new `controlFrameRateLimit` property to `NIOHTTP2Handler.ConnectionConfiguration`. - Plumbed the configuration argument to `NIOHTTP2Handler` initializers. ### Result Mechanism in place to avoid endpoints from being overwhelmed by excessive PING, SETTINGS, PRIORITY, ALTSVC, or ORIGIN frames.