Let Upgrade handler remove other HTTP handlers. (#144)

Motivation:

The HTTP pipeline may contain other HTTP protocol specific handlers,
beyond just the ones that the upgrade handler knows explicitly. It should
be possible to get the upgrade handler to remove those at the right time.

Modifications:

Add extra support for removing handlers.

Result:

It'll be possible for the HTTP upgrade logic to remove things like the
pipelining handler at upgrade time.
This commit is contained in:
Cory Benfield authored and GitHub committed 2018-03-15 01:34:03 +09:00
1 parent 25dd80aa9f
commit 79a87ab76a
3 files changed
+131 -105

No files matched your search

+1 -1
View File
@@ -153,7 +153,7 @@ public extension ChannelPipeline {
let requestDecoder = HTTPRequestDecoder()
let upgrader = HTTPServerUpgradeHandler(upgraders: upgraders,
httpEncoder: responseEncoder,
httpDecoder: requestDecoder,
extraHTTPHandlers: [requestDecoder],
upgradeCompletionHandler: upgradeCompletionHandler)
return addHandlers(responseEncoder, requestDecoder, upgrader, first: first)
}