File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,9 @@ impl FaasEnvironmentName {
223
223
fn new ( ) -> Option < Self > {
224
224
use FaasEnvironmentName :: * ;
225
225
let mut found: Option < Self > = None ;
226
- if var_set ( "AWS_EXECUTION_ENV" ) || var_set ( "AWS_LAMBDA_RUNTIME_API" ) {
226
+ let lambda_env = env:: var_os ( "AWS_EXECUTION_ENV" )
227
+ . map_or ( false , |v| v. to_string_lossy ( ) . starts_with ( "AWS_Lambda_" ) ) ;
228
+ if lambda_env || var_set ( "AWS_LAMBDA_RUNTIME_API" ) {
227
229
found = Some ( AwsLambda ) ;
228
230
}
229
231
if var_set ( "VERCEL" ) {
Original file line number Diff line number Diff line change @@ -114,3 +114,9 @@ async fn invalid_wrong_type() -> Result<()> {
114
114
] )
115
115
. await
116
116
}
117
+
118
+ #[ cfg_attr( feature = "tokio-runtime" , tokio:: test) ]
119
+ #[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
120
+ async fn invalid_aws_not_lambda ( ) -> Result < ( ) > {
121
+ check_faas_handshake ( & [ ( "AWS_EXECUTION_ENV" , "EC2" ) ] ) . await
122
+ }
You can’t perform that action at this time.
0 commit comments