Created
May 21, 2020 16:08
-
-
Save thebeebs/1402bdec3c39968746542fe32c3bc5ed to your computer and use it in GitHub Desktop.
Lambda Injection without a decorator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<APIGatewayProxyResponse> FunctionHandlerException(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context) | |
{ | |
return await new ChaosWrap<InjectException>().Execute(async () => | |
{ | |
var location = await GetCallingIP(); | |
var body = new Dictionary<string, string> | |
{ | |
{"message", "hello world"}, | |
{"location", location} | |
}; | |
return new APIGatewayProxyResponse | |
{ | |
Body = JsonConvert.SerializeObject(body), | |
StatusCode = 200, | |
Headers = new Dictionary<string, string> {{"Content-Type", "application/json"}} | |
}; | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment