Skip to content

Commit c8911ff

Browse files
committed
Minor style and typo fixes
1 parent 5abb791 commit c8911ff

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Sources/Gatekeeper/Gatekeeper+Vapor/Application+Gatekeeper.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extension Application.Gatekeeper {
6767
self.run = run
6868
}
6969

70-
/// A provider that uses the defaultt Vapor in-memory cache.
70+
/// A provider that uses the default Vapor in-memory cache.
7171
public static var memory: Self {
7272
.init { app in
7373
app.caches.use(.memory)
@@ -98,7 +98,7 @@ extension Application.Gatekeeper {
9898
}
9999
}
100100

101-
// MARK: - Gatekeeper+Keymaker
101+
// MARK: - Gatekeeper+Keymakers
102102
extension Application.Gatekeeper {
103103
public struct KeyMakers {
104104
private let gatekeeper: Application.Gatekeeper

Sources/Gatekeeper/Gatekeeper+Vapor/Request+Gatekeeper.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extension Request {
99
.init(
1010
cache: cache ?? application.gatekeeper.caches.cache.for(self),
1111
config: config ?? application.gatekeeper.config,
12-
identifier: keyMaker ?? application.gatekeeper.keyMakers.keyMaker)
12+
identifier: keyMaker ?? application.gatekeeper.keyMakers.keyMaker
13+
)
1314
}
1415
}

Sources/Gatekeeper/Request+Hostname.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import Vapor
22

33
extension Request {
44
var hostname: String? {
5-
return headers.first(name: .xForwardedFor) ?? remoteAddress?.hostname
5+
headers.first(name: .xForwardedFor) ?? remoteAddress?.hostname
66
}
77
}

Tests/GatekeeperTests/GatekeeperTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class GatekeeperTests: XCTestCase {
99
app.gatekeeper.config = .init(maxRequests: 10, per: .second)
1010

1111
app.grouped(GatekeeperMiddleware()).get("test") { req -> HTTPStatus in
12-
return .ok
12+
return .ok
1313
}
1414

1515
for i in 1...10 {

0 commit comments

Comments
 (0)