mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
ChannelHandler: provide static (un)wrap(In|Out)bound(In|Out) (#2791)
This commit is contained in:
1 parent
223b0e8eac
commit
7948ed2104
72 files changed
+369
-343
No files matched your search
@@ -29,7 +29,7 @@ public final class NIOHTTPRequestHeadersValidator: ChannelOutboundHandler, Remov
|
||||
public init() { }
|
||||
|
||||
public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?) {
|
||||
switch self.unwrapOutboundIn(data) {
|
||||
switch Self.unwrapOutboundIn(data) {
|
||||
case .head(let head):
|
||||
guard head.headers.areValidToSend else {
|
||||
promise?.fail(HTTPParserError.invalidHeaderToken)
|
||||
@@ -67,7 +67,7 @@ public final class NIOHTTPResponseHeadersValidator: ChannelOutboundHandler, Remo
|
||||
public init() { }
|
||||
|
||||
public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise<Void>?) {
|
||||
switch self.unwrapOutboundIn(data) {
|
||||
switch Self.unwrapOutboundIn(data) {
|
||||
case .head(let head):
|
||||
guard head.headers.areValidToSend else {
|
||||
promise?.fail(HTTPParserError.invalidHeaderToken)
|
||||
|
||||
Reference in new issue
Block a user