mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
Motivation: Applications might want to support H2 (when available) and HTTP1 (as a fallback). The application logic should not change between the two versions of the protocol and the code to configure support for both the protocols is boilerplate and can be provided as an helper function. Modifications: This PR adds an helper function to configure HTTP1 or H2 pipelines according to the protocol negotiated by the TLS handler. Result: Applications that need to support clients using both HTTP1 and H2 can configure their channels by calling `configureCommonHTTPServerPipeline`, which should reduce the boilerplate they have to write. Co-Authored-By: Cory Benfield <lukasa@apple.com>