apple / swift-nio-http2

HTTP/2 support for SwiftNIO
https://swiftpackageindex.com/apple/swift-nio-http2/main/documentation/niohttp2
Apache License 2.0
462 stars 82 forks source link

Content-Length errors shouldn't crash #371

Closed Lukasa closed 1 year ago

Lukasa commented 1 year ago

Motivation:

When we added new content length verification and new errors, we didn't update the places that were handling the old error. This code updates that logic to ensure that we don't crash.

Modifications:

Add new internal protocol to which the content length validation errors conform. Catch that protocol instead.

Result:

No crashes on invalid content-length