From e1d33625a4a5535dae7585768bf43e95755b3074 Mon Sep 17 00:00:00 2001 From: Mark Sailes Date: Thu, 11 Nov 2021 09:18:05 +0000 Subject: [PATCH 1/2] Allow the user-agent to be overridden by 3rd party users of the runtime-interface-client. --- .../lambda/runtime/api/client/runtimeapi/NativeClient.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java index f3cda8bc..9ac9a8be 100644 --- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java +++ b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java @@ -38,9 +38,10 @@ class NativeClient { System.exit(-1); } String userAgent = String.format( - "aws-lambda-java/%s-%s" , + "%s/%s-%s", + System.getProperty("RUNTIME_CLIENT", "aws-lambda-java"), System.getProperty("java.vendor.version"), - NativeClient.class.getPackage().getImplementationVersion()); + System.getProperty("RUNTIME_CLIENT_VERSION", NativeClient.class.getPackage().getImplementationVersion())); initializeClient(userAgent.getBytes()); } From 2890199fa90dd8d9011e62dc8226eb57054e5c4e Mon Sep 17 00:00:00 2001 From: Mark Sailes Date: Thu, 11 Nov 2021 10:11:58 +0000 Subject: [PATCH 2/2] Changed the env var names to be more unique / conflict free. --- .../lambda/runtime/api/client/runtimeapi/NativeClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java index 9ac9a8be..b4c78547 100644 --- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java +++ b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java @@ -39,9 +39,9 @@ class NativeClient { } String userAgent = String.format( "%s/%s-%s", - System.getProperty("RUNTIME_CLIENT", "aws-lambda-java"), + System.getProperty("AWS_LAMBDA_RUNTIME_CLIENT_NAME_OVERRIDE", "aws-lambda-java"), System.getProperty("java.vendor.version"), - System.getProperty("RUNTIME_CLIENT_VERSION", NativeClient.class.getPackage().getImplementationVersion())); + System.getProperty("AWS_LAMBDA_RUNTIME_CLIENT_VERSION_OVERRIDE", NativeClient.class.getPackage().getImplementationVersion())); initializeClient(userAgent.getBytes()); }