Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various documentation fixs #685

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Hummingbird/Server/ChildRequestContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
}

extension ChildRequestContext {
/// ChildRequestContext can never to created from it Source `Never` so add preconditionFailure
public init(source: Source) {
// ChildRequestContext can never be created from it's Source `Never` so add preconditionFailure

Check warning on line 36 in Sources/Hummingbird/Server/ChildRequestContext.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Hummingbird/Server/ChildRequestContext.swift#L36

Added line #L36 was not covered by tests
preconditionFailure("Cannot reach this.")
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/HummingbirdHTTP2/HTTP2UpgradeChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
self.http1.responder
}

/// Initialize HTTP2Channel
/// Initialize HTTP2Channel
/// - Parameters:
/// - tlsConfiguration: TLS configuration
/// - additionalChannelHandlers: Additional channel handlers to add to stream channel pipeline after HTTP part decoding and
Expand All @@ -66,7 +66,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
)
}

/// Initialize HTTP2UpgradeChannel
/// Initialize HTTP2UpgradeChannel
/// - Parameters:
/// - tlsConfiguration: TLS configuration
/// - configuration: HTTP2 channel configuration
Expand All @@ -84,9 +84,9 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
self.http2 = HTTP2Channel(responder: responder, configuration: configuration)
}

/// Initialize HTTP2UpgradeChannel
/// Initialize HTTP2UpgradeChannel
/// - Parameters:
/// - tlsConfiguration: TLS configuration
/// - tlsChannelConfiguration: TLS channel configuration
/// - configuration: HTTP2 channel configuration
/// - responder: Function returning a HTTP response for a HTTP request
public init(
Expand Down
8 changes: 4 additions & 4 deletions Sources/HummingbirdHTTP2/HTTPServerBuilder+http2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import NIOCore
import NIOSSL

extension HTTPServerBuilder {
/// Build HTTP channel with HTTP2 upgrade
/// Build HTTP channel with HTTP2 upgrade
///
/// Use in ``Hummingbird/Application`` initialization.
/// ```
Expand Down Expand Up @@ -45,7 +45,7 @@ extension HTTPServerBuilder {
}
}

/// Build HTTP channel with HTTP2 upgrade
/// Build HTTP channel with HTTP2 upgrade
///
/// Use in ``Hummingbird/Application`` initialization.
/// ```
Expand All @@ -71,7 +71,7 @@ extension HTTPServerBuilder {
}
}

/// Build HTTP channel with HTTP2 upgrade
/// Build HTTP channel with HTTP2 upgrade
///
/// Use in ``Hummingbird/Application`` initialization.
/// ```
Expand All @@ -81,7 +81,7 @@ extension HTTPServerBuilder {
/// )
/// ```
/// - Parameters:
/// - tlsConfiguration: TLS configuration
/// - tlsChannelConfiguration: TLS channel configuration
/// - configuration: HTTP2 Upgrade channel configuration
/// - Returns: HTTPChannelHandler builder
public static func http2Upgrade(
Expand Down
27 changes: 18 additions & 9 deletions Sources/HummingbirdTLS/HTTPServerBuilder+tls.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import HummingbirdCore
import NIOSSL

extension HTTPServerBuilder {
/// Build server supporting HTTP with TLS
/// Build server supporting HTTP with TLS
///
/// Use in ``Hummingbird/Application`` initialization.
/// ```
Expand All @@ -25,6 +25,7 @@ extension HTTPServerBuilder {
/// server: .tls(.http1(), tlsConfiguration: tlsConfiguration)
/// )
/// ```
///
/// - Parameters:
/// - base: Base child channel to wrap with TLS
/// - tlsConfiguration: TLS configuration
Expand All @@ -38,15 +39,23 @@ extension HTTPServerBuilder {
}
}

/// Build server supporting HTTP with TLS
/// Build server supporting HTTP with TLS
///
/// Use in ``Hummingbird/Application`` initialization.
///
/// This version of the function adds extra configuration including a custom verification callback
/// which can be used to override the standard certificate verification.
///
/// ```
/// let app = Application(
/// router: router,
/// server: .tls(.http1(), configuration: .init(
/// tlsConfiguration: tlsConfiguration,
/// customAsyncVerificationCallback: { certificates in .certificateVerified }
/// ))
/// )
/// ```
///
/// Use in ``Hummingbird/Application`` initialization.
/// ```
/// let app = Application(
/// router: router,
/// server: .tls(.http1(), tlsConfiguration: tlsConfiguration)
/// )
/// ```
/// - Parameters:
/// - base: Base child channel to wrap with TLS
/// - configuration: TLS channel configuration
Expand Down