Closed keyvariable closed 11 months ago
Can you clarify what version of swift-nio-http2 you're using?
Additionally it'd be quite useful if you can produce a small repro for this: the code appears to handle this use-case appropriately, so I'd really like to see if I can reproduce this locally.
Can you clarify what version of swift-nio-http2 you're using?
Thank you! I had been using 1.22.0. On 1.27.0 no error occurs.
I have a server that uses
HTTP2FramePayloadToHTTP1ServerCodec
. Server provides a response with result of long-running calculations in body of 256 bytes. I'd like to use the same code for GET and HEAD methods but actually perform calculations only for GET method. When I writeContent-Length: 256
header and conditionally omit body for HEAD method,ContentLengthViolated(file: "/swift-nio-http2/Sources/NIOHTTP2/ContentLengthVerifier.swift", line: 45)
error occurs.Is there a way to write responses for HEAD method with non-zero Content-Length and no body using
HTTP2FramePayloadToHTTP1ServerCodec
?I could write fake bytes but it's a wrong way.