Skip to content

Commit a9a2875

Browse files
committed
Formatting
1 parent 0e84f21 commit a9a2875

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

Sources/HummingbirdRouter/RouteGroup.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public struct RouteGroup<Context: RouterRequestContext, Handler: MiddlewareProto
1919
public typealias Input = Request
2020
public typealias Output = Response
2121

22-
@usableFromInline
2322
/// Full URI path to route
23+
@usableFromInline
2424
let fullPath: RouterPath
2525
/// Path local to group route this group is defined in.
2626
@usableFromInline

Sources/HummingbirdTLS/TLSChannel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public struct TLSChannel<BaseChannel: ServerChildChannel>: ServerChildChannel {
4242
}
4343
}
4444

45-
@inlinable
4645
/// handle messages being passed down the channel pipeline
4746
/// - Parameters:
4847
/// - value: Object to process input/output on child channel
4948
/// - logger: Logger to use while processing messages
49+
@inlinable
5050
public func handle(value: BaseChannel.Value, logger: Logging.Logger) async {
5151
await self.baseChannel.handle(value: value, logger: logger)
5252
}

Tests/HummingbirdTests/FileMiddlewareTests.swift

+1-22
Original file line numberDiff line numberDiff line change
@@ -316,35 +316,14 @@ final class FileMiddlewareTests: XCTestCase {
316316
}
317317
}
318318

319-
func testOnThrow404() async throws {
320-
let router = Router()
321-
router.middlewares.add(FileMiddleware(".", searchForIndexHtml: true))
322-
router.get { _, _ -> String in
323-
throw HTTPError(.notFound)
324-
}
325-
let app = Application(responder: router.buildResponder())
326-
327-
let text = "Test file contents"
328-
let data = Data(text.utf8)
329-
let fileURL = URL(fileURLWithPath: "index.html")
330-
XCTAssertNoThrow(try data.write(to: fileURL))
331-
defer { XCTAssertNoThrow(try FileManager.default.removeItem(at: fileURL)) }
332-
333-
try await app.test(.router) { client in
334-
try await client.execute(uri: "/", method: .get) { response in
335-
XCTAssertEqual(String(buffer: response.body), text)
336-
}
337-
}
338-
}
339-
340319
func testOnThrowCustom404() async throws {
341320
let router = Router()
342321
router.middlewares.add(FileMiddleware(".", searchForIndexHtml: true))
343322
struct Custom404Error: HTTPResponseError {
344323
var status: HTTPResponse.Status { .notFound }
345324

346325
func response(from request: Request, context: some RequestContext) throws -> Response {
347-
Response(status: status)
326+
Response(status: self.status)
348327
}
349328
}
350329
router.get { _, _ -> String in

0 commit comments

Comments
 (0)