Skip to content

Commit c82a3a5

Browse files
committed
only send header once
1 parent a73726d commit c82a3a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: Tests/AsyncHTTPClientTests/HTTP2ClientTests.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ private final class SendHeaderAndWaitChannelHandler: ChannelInboundHandler {
379379
typealias OutboundOut = HTTPServerResponsePart
380380

381381
func channelRead(context: ChannelHandlerContext, data: NIOAny) {
382-
context.writeAndFlush(wrapOutboundOut(.head(HTTPResponseHead(
382+
let requestPart = self.unwrapInboundIn(data)
383+
guard case .end = requestPart else { return }
384+
385+
context.writeAndFlush(self.wrapOutboundOut(.head(HTTPResponseHead(
383386
version: HTTPVersion(major: 1, minor: 1),
384387
status: .ok
385388
))

0 commit comments

Comments
 (0)