swift-nio-extras icon indicating copy to clipboard operation
swift-nio-extras copied to clipboard

Should NIOHTTP1 Swift HTTPTypes conversion code be made public?

Open adam-fowler opened this issue 1 year ago • 1 comments

I'm talking about the code that can be found here

The NIOWebSocket upgrade helpers are reliant on the NIOHTTP1 types, specifically HTTPHead and HTTPHeaders . If a project is built using the new HTTP Types it will need to convert from the supplied NIOHTTP1 types to the new types. In theory the project could have its own conversion code but it might be a good idea to make the NIOExtras conversion code the official implementation.

Another situation where this conversion is being made is in the OpenAPI transports. Both Vapor and Hummingbird rely on the NIOHTTP1 types and have to convert to the new HTTP types to pass on the HTTP request to the openapi runtime and convert back to return the HTTP response.

adam-fowler avatar Jan 03 '24 14:01 adam-fowler