Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The API endpoint in Amazon's implementation of Lambda used the path `/2015-03-31/functions/[func]/invocations` to invoke the function. `[func]` the name of the function and is set as the value of the `AWS_LAMBDA_FUNCTION_NAME` environment variable when the function is executing on AWS. The emulator uses a hard coded endpoint of `/2015-03-31/functions/function/invocations`. This is even the case when the `AWS_LAMBDA_FUNCTION_NAME` environment variable is set to another value. This patch changes the endpoint URL when the `AWS_LAMBDA_FUNCTION_NAME` environment variable is set. In this case the invocation URL will be `/2015-03-31/functions/${AWS_LAMBDA_FUNCTION_NAME}/invocations`. When the environment variable isn't set, the current behaviour persists and the function name is set to `function`. The end result is the emulator behaviour is closer to the real environment the functions execute in. This PR fixes aws#43 I raised a few weeks ago.
- Loading branch information