File tree 1 file changed +4
-0
lines changed
Sources/AWSLambdaRuntimeCore
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ internal final class HTTPClient {
27
27
private var state = State . disconnected
28
28
private var executing = false
29
29
30
+ private static let headers = HTTPHeaders ( [ ( " user-agent " , " Swift-Lambda/Unknown " ) ] )
31
+
30
32
init ( eventLoop: EventLoop , configuration: Lambda . Configuration . RuntimeEngine ) {
31
33
self . eventLoop = eventLoop
32
34
self . configuration = configuration
@@ -37,13 +39,15 @@ internal final class HTTPClient {
37
39
self . execute ( Request ( targetHost: self . targetHost,
38
40
url: url,
39
41
method: . GET,
42
+ headers: HTTPClient . headers,
40
43
timeout: timeout ?? self . configuration. requestTimeout) )
41
44
}
42
45
43
46
func post( url: String , body: ByteBuffer ? , timeout: TimeAmount ? = nil ) -> EventLoopFuture < Response > {
44
47
self . execute ( Request ( targetHost: self . targetHost,
45
48
url: url,
46
49
method: . POST,
50
+ headers: HTTPClient . headers,
47
51
body: body,
48
52
timeout: timeout ?? self . configuration. requestTimeout) )
49
53
}
You can’t perform that action at this time.
0 commit comments