diff --git a/Sources/AWSLambdaRuntimeCore/HTTPClient.swift b/Sources/AWSLambdaRuntimeCore/HTTPClient.swift index 4945b439..f3d073d3 100644 --- a/Sources/AWSLambdaRuntimeCore/HTTPClient.swift +++ b/Sources/AWSLambdaRuntimeCore/HTTPClient.swift @@ -27,6 +27,8 @@ internal final class HTTPClient { private var state = State.disconnected private var executing = false + private static let headers = HTTPHeaders([("user-agent", "Swift-Lambda/Unknown")]) + init(eventLoop: EventLoop, configuration: Lambda.Configuration.RuntimeEngine) { self.eventLoop = eventLoop self.configuration = configuration @@ -37,6 +39,7 @@ internal final class HTTPClient { self.execute(Request(targetHost: self.targetHost, url: url, method: .GET, + headers: HTTPClient.headers, timeout: timeout ?? self.configuration.requestTimeout)) } @@ -44,6 +47,7 @@ internal final class HTTPClient { self.execute(Request(targetHost: self.targetHost, url: url, method: .POST, + headers: HTTPClient.headers, body: body, timeout: timeout ?? self.configuration.requestTimeout)) }