Hi,
I have a gatsby served page and like many before me I have the issue of when URI does not include index.html it does not find the page to serve.
I've followed countless guides now from adding a function to alter the viewer request and lambda@edge to trigger change of origin request.
I've tried both node and python handlers and my current one is python
def lambda_handler(event, context):
request = event['Records'][0]['cf']['request']
if request['uri'].endswith("/"):
request['uri'] = f"{request['uri']}index.html"
return request
If I return a bad value my cloudfront complains and refuses to load, but when i have the code as above the page loads fine but the trigger does not happen, i cannot find execution of the trigger in any region - only when it's generating an error.
Why is the function not triggerning/alerting the request uri?