24
24
25
25
import Vapor
26
26
27
- extension Request : Authenticatable { }
27
+ extension Vapor . Request : Vapor . Authenticatable { }
28
28
29
29
extension Request {
30
30
var isAuthenticated : Bool {
@@ -37,14 +37,14 @@ extension Application {
37
37
func on( _ methods: [ HTTPMethod ] ,
38
38
_ path: PathComponent ... ,
39
39
body: HTTPBodyStreamStrategy = . collect,
40
- use closure: @escaping ( Request ) throws -> some ResponseEncodable ) -> [ Route ] {
40
+ use closure: @escaping @ Sendable ( Request) throws -> some ResponseEncodable ) -> [ Route ] {
41
41
methods. map { on ( $0, path, body: body, use: closure) }
42
42
}
43
43
44
44
@discardableResult
45
45
func onMethods( _ methods: [ HTTPMethod ] ,
46
46
body: HTTPBodyStreamStrategy = . collect,
47
- use closure: @escaping ( Request ) throws -> some ResponseEncodable ) -> [ Route ] {
47
+ use closure: @escaping @ Sendable ( Request) throws -> some ResponseEncodable ) -> [ Route ] {
48
48
methods. map { on ( $0, . constant( $0. rawValue. lowercased ( ) ) , body: body, use: closure) }
49
49
}
50
50
}
@@ -54,7 +54,7 @@ extension RoutesBuilder {
54
54
func on( _ methods: [ HTTPMethod ] ,
55
55
_ path: PathComponent ... ,
56
56
body: HTTPBodyStreamStrategy = . collect,
57
- use closure: @escaping ( Request ) throws -> some ResponseEncodable ) -> [ Route ] {
57
+ use closure: @escaping @ Sendable ( Request) throws -> some ResponseEncodable ) -> [ Route ] {
58
58
methods. map { on ( $0, path, body: body, use: closure) }
59
59
}
60
60
}
0 commit comments