Skip to content

Commit 79254a2

Browse files
committed
externalize version number
1 parent d72c59e commit 79254a2

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Sources/AWSLambdaRuntime/ControlPlaneRequestEncoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct ControlPlaneRequestEncoder: _EmittingChannelHandler {
9393
extension String {
9494
static let CRLF: String = "\r\n"
9595

96-
static let userAgent = "Swift-Lambda/2.0"
96+
static let userAgent = "Swift-Lambda/\(Version.current)"
9797
static let userAgentHeader: String = "user-agent: \(userAgent)\r\n"
9898
static let unhandledErrorHeader: String = "lambda-runtime-function-error-type: Unhandled\r\n"
9999

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the SwiftAWSLambdaRuntime open source project
4+
//
5+
// Copyright (c) 2017-2018 Apple Inc. and the SwiftAWSLambdaRuntime project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
/// Library version of the AWS Lambda Runtime.
16+
/// This is used in the User Agent header when making requests to the AWS Lambda data Plane.
17+
package enum Version {
18+
/// The current version of the AWS Lambda Runtime.
19+
public static let current = "2.0"
20+
}

0 commit comments

Comments
 (0)