From 63c7b439908ce1ccca35f3d98290297e13fc797e Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Mon, 10 Jun 2024 11:30:09 +0100 Subject: [PATCH] swift format --- Sources/Hummingbird/Server/RequestContext.swift | 6 +++--- Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Hummingbird/Server/RequestContext.swift b/Sources/Hummingbird/Server/RequestContext.swift index 564cdda80..102a9df25 100644 --- a/Sources/Hummingbird/Server/RequestContext.swift +++ b/Sources/Hummingbird/Server/RequestContext.swift @@ -135,11 +135,11 @@ public struct ServerRequestContextSource: RequestContextSource { public let channel: Channel public let logger: Logger - public var allocator: ByteBufferAllocator { channel.allocator } + public var allocator: ByteBufferAllocator { self.channel.allocator } } + /// Protocol for a request context that can be created from a NIO Channel -public protocol RequestContext: BaseRequestContext where Source == ServerRequestContextSource { -} +public protocol RequestContext: BaseRequestContext where Source == ServerRequestContextSource {} /// Implementation of a basic request context that supports everything the Hummingbird library needs public struct BasicRequestContext: RequestContext { diff --git a/Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift b/Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift index 5216f9f28..b6475b326 100644 --- a/Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift +++ b/Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift @@ -42,13 +42,13 @@ public struct HTTP1Channel: ServerChildChannel, HTTPChannelHandler { public func setup(channel: Channel, logger: Logger) -> EventLoopFuture { let childChannelHandlers: [any ChannelHandler] = [HTTP1ToHTTPServerCodec(secure: false)] + self.additionalChannelHandlers() + [ - HTTPUserEventHandler(logger: logger) + HTTPUserEventHandler(logger: logger), ] return channel.eventLoop.makeCompletedFuture { try channel.pipeline.syncOperations.configureHTTPServerPipeline( - withPipeliningAssistance: false, // HTTP is pipelined by NIOAsyncChannel + withPipeliningAssistance: false, // HTTP is pipelined by NIOAsyncChannel withErrorHandling: true, - withOutboundHeaderValidation: false // Swift HTTP Types are already doing this validation + withOutboundHeaderValidation: false // Swift HTTP Types are already doing this validation ) try channel.pipeline.syncOperations.addHandlers(childChannelHandlers) return try NIOAsyncChannel(