diff --git a/README.md b/README.md index f5e3742..dfb5348 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Make sure the project is built: make init build ``` Then, -* to run unit tests: `make test` +* to run unit tests: `make test-unit` * to run integration tests: `make test-integ` * to run smoke tests: `make test-smoke` diff --git a/lib/aws_lambda_ric.rb b/lib/aws_lambda_ric.rb index d898664..1e30c6c 100755 --- a/lib/aws_lambda_ric.rb +++ b/lib/aws_lambda_ric.rb @@ -106,7 +106,7 @@ def send_init_error_to_server(err) @lambda_server.send_init_error(error_object: ex.to_lambda_response, error: ex) end - def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active: true) + def send_error_response(lambda_invocation, err, exit_code = nil, runtime_loop_active = true) error_object = err.to_lambda_response @lambda_server.send_error_response( request_id: lambda_invocation.request_id, diff --git a/lib/aws_lambda_ric/lambda_context.rb b/lib/aws_lambda_ric/lambda_context.rb index 7ed2da9..635d6d1 100644 --- a/lib/aws_lambda_ric/lambda_context.rb +++ b/lib/aws_lambda_ric/lambda_context.rb @@ -17,8 +17,8 @@ def initialize(request) @function_name = ENV['AWS_LAMBDA_FUNCTION_NAME'] @memory_limit_in_mb = ENV['AWS_LAMBDA_FUNCTION_MEMORY_SIZE'] @function_version = ENV['AWS_LAMBDA_FUNCTION_VERSION'] - @identity = JSON.parse(request['Lambda-Runtime-Cognito-Identity']) if request['Lambda-Runtime-Cognito-Identity'] - @client_context = JSON.parse(request['Lambda-Runtime-Client-Context']) if request['Lambda-Runtime-Client-Context'] + @identity = JSON.parse(request['Lambda-Runtime-Cognito-Identity']) unless request['Lambda-Runtime-Cognito-Identity'].to_s.empty? + @client_context = JSON.parse(request['Lambda-Runtime-Client-Context']) unless request['Lambda-Runtime-Client-Context'].to_s.empty? end def get_remaining_time_in_millis